Infrared aerial target detection method based on selective state space model
By using the selective state space model in infrared aerial photography target detection to build an improved YOLO framework target detection network, the problem of poor target detection results in infrared aerial photography environment is solved, and efficient and accurate target detection results are achieved.
Patent Information
- Application Number
- CN202410366655.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-03-28
AI Technical Summary
The prior art is difficult to achieve efficient and accurate target detection in infrared aerial photography environment, especially under night infrared conditions, the target detection effect is poor, and there are noise and blur problems, resulting in false detection and missed detection.
The selective state space model (SSM) is used to construct the target detection network. By improving the backbone network, neck network and head network of the YOLO framework, the Focal Loss loss function and feature aggregation-distribution structure are introduced, combined with the selective state space model. Attention mechanism enhances the feature extraction and detection capabilities of the network.
It achieves efficient and accurate detection of UAV aerial photography targets in the night-time infrared environment, improves detection accuracy and efficiency, reduces false detections and missed detections, and meets the requirements for night-time infrared aerial photography target detection.
Smart Images

Figure CN118537752B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing methods, and in particular to an infrared aerial target detection method of a selective state space model. Background Art
[0002] At present, drones are widely used in various industries due to their flexibility, low cost, and ease of use. In particular, they have shown excellent application value in the fields of intelligent transportation, agriculture, and ocean. Ground personnel can easily observe the ground situation through the drone's onboard camera equipment and then respond to the ground situation. In the infrared shots at night, the drone not only moves quickly, but also has more noise points in the pictures, and problems such as blurred pictures are more likely to occur. Through manual analysis of the pictures by ground personnel, it is easy to have false detections and missed detections to a certain extent. Therefore, for application scenarios with high requirements for detection efficiency, manual detection methods have limitations.
[0003] With the development of artificial intelligence technology, target detection, as one of the application directions of artificial intelligence technology, has been widely studied. At present, target detection methods based on deep learning technology are mainly divided into two categories, namely one-stage and two-stage target detection methods. The one-stage target detection algorithm directly predicts the location and category of the target, and has high real-time performance. The representative algorithms of the one-stage target detection algorithm are the YOLO algorithm and the SSD algorithm. The two-stage target detection algorithm first generates candidate locations, and then classifies and locates the candidate locations. It has high detection accuracy, but poor real-time performance. The representative algorithms of the two-stage target detection algorithm are the R-CNN algorithm and the Fast R-CNN algorithm. In addition, there are also end-to-end target detection algorithms based on the self-attention mechanism that are being widely studied. This type of algorithm does not require cumbersome post-processing. The network directly outputs the location and classification of the target. The representative algorithm of this type of algorithm is the DETR algorithm.
[0004] The development of target detection algorithms has overcome the limitations of manual detection methods, and therefore has been widely used in the field of drone aerial photography. Fu Jinyi et al. proposed an improved YOLOv8 small target detection algorithm for aerial images to address the problem of small targets in drone aerial photography. By improving the C2f module and the head network, the detection effect of small targets was further improved. In order to improve the rotation robustness of the traditional drone infrared target recognition algorithm to the input image, Xiao Feng et al. proposed an infrared image target recognition algorithm with rotation equivariance. By expanding the input channel, adding rotation equivariant convolution, and attention mechanism, the effect of night infrared target detection was enhanced. In order to improve the detection accuracy of infrared aerial photography small target detection, Zhu Zijian et al. proposed an aerial photography infrared vehicle small target detection method based on parallel fusion network. The network built with parallel residual blocks was used as the backbone network, replacing the NMS algorithm, etc., and showed good performance in infrared vehicle small target detection under complex motion background.
[0005] At present, most object detection algorithms are based on CNN and self-attention mechanism. However, CNN-based object detection algorithms are subject to the limitations of CNN and lack the ability to extract long-distance semantic information. This also leads to insufficient information extraction between input image pixels by the network, which in turn affects the detection effect. Although the object detection algorithm based on the self-attention mechanism solves the problem of insufficient long-distance semantic information extraction of CNN, its high time complexity greatly increases the hardware overhead when running the network. Summary of the invention
[0006] The technical problem to be solved by the present invention is how to provide a method for accurately detecting infrared aerial photography targets.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for infrared aerial photography target detection based on a selective state space model, comprising the following steps:
[0008] S1: Obtain an infrared aerial image dataset, process the dataset to obtain a dataset in YOLO format, and divide the dataset into a training set, a test set, and a validation set;
[0009] S2: construct a target detection network based on a selective state space model, modify the loss function of the target detection network, introduce the Focal Loss loss function, and adjust the network hyperparameters through the validation set to optimize the training result of the target detection network;
[0010] S3: Input the infrared aerial images in the test set into the target detection network for target detection, and evaluate the network performance in combination with the evaluation indicators.
[0011] A further technical solution is that step S1 specifically includes the following steps:
[0012] S11, obtain the infrared aerial photography target data set from the network, and convert the initial VOC format data set into a YOLO format data set;
[0013] S12, dividing the converted data set into a training set, a test set, and a validation set in a ratio of 8:1:1;
[0014] S13, before inputting into the network training, the data is enhanced through the Mosiac module.
[0015] A further technical solution is that: the target detection network adopts the backbone network, neck network and head network structure of the YOLO framework; the backbone network is used to extract image features respectively, and the neck network is used to fuse the backbone network to extract multi-scale features, and the head network is used to further extract the multi-scale features; the C2f module in the backbone network is improved, and the C2f extracted features are further processed using an attention module based on a selective state space model to obtain a C2f-Attention module; a feature aggregation-distribution structure is introduced in the neck network, and the features extracted by the backbone network are fused and then uniformly processed by a feature extraction block VSS Block based on a selective state space model, and then restored to the features of the original scale.
[0016] A further technical solution is that: the backbone network includes a convolution block and a C2f module, wherein a convolution block with a convolution kernel of 3 and a step size of 2 is used to downsample the feature map, and each downsampling reduces the size of the feature map to 1 / 2 of the original size, and the C2f module is used to extract features from the feature map, and the backbone network outputs feature maps with sizes of 8*8, 16*16, and 32*32, which are referred to as S5 feature maps, S4 feature maps, and S3 feature maps, respectively;
[0017] The neck network is a PAN structure. The S5 feature map output by the backbone network is interpolated and upsampled, and then spliced with the S4 feature map. The spliced feature map is then fused through the C2f module and upsampled and spliced with the S3 feature map. After that, the feature map is downsampled through the reverse operation and then spliced with the previous feature map of the same size. The neck network outputs the S5* feature map, S4* feature map, and S3* feature map that fuse multi-scale information.
[0018] The head network consists of three detection heads, each of which recognizes the S5* feature map, S4* feature map and S3* feature map respectively. Each detection head has two branches, each of which includes two 3*3 convolutions and one 1*1 convolution to decode the feature map into classification and anchor boxes.
[0019] The image is input into the trained target detection network based on the selective state space model. The network outputs the category and location of the target in the image through reasoning, and the redundant results are filtered out by the NMS algorithm. The filtered results are drawn using the image processing library to obtain the final detection image. The network performance is evaluated using mAP50 and mAP50:95 as well as the number of parameters as evaluation indicators.
[0020] The beneficial effects of adopting the above technical scheme are: the method described in the present invention constructs a target detection network based on a selective state space model. Compared with the target detection network based on the traditional CNN and self-attention mechanism, it has the ability to extract long-distance semantic information while having linear time complexity; a new attention mechanism is proposed based on the selective state space model, which has less performance overhead and stronger perception of key semantic information; the neck network in the target detection network is improved, and the feature aggregation-distribution structure based on the selective state space model is integrated to further enhance the feature extraction ability of the neck network, and the detection effect of targets of different scales in drone aerial photography under night infrared environment is better; the method described in the present invention has achieved an mAP50 index of 0.652 and an mAP50:90 index of 0.399 for the target through testing on the test set, and the number of parameters is only 12.11M. In the experimental environment, the FPS reaches 147, which meets the requirements for the night infrared aerial photography target detection method. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0022] Figure 1 is a flow chart of the method described in an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of the structure of the target detection network in the method according to an embodiment of the present invention;
[0024] Figure 3 A schematic diagram of the structure of a C2f-Attention module provided in an embodiment of the present invention;
[0025] Figure 4 A schematic diagram of the structure of the SSM-Attention module provided in an embodiment of the present invention;
[0026] Figure 5 A schematic diagram of the structure of the feature aggregation-distribution module provided in an embodiment of the present invention;
[0027] Figure 6 A test result diagram provided by an embodiment of the present invention;
[0028] Figure 7A data set sample type distribution structure diagram is provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0031] Overall, such as Figure 1 As shown, the embodiment of the present invention discloses a
[0032] S1: Obtain an infrared aerial image dataset, process the dataset to obtain a dataset in YOLO format, and divide the dataset into a training set, a test set, and a validation set;
[0033] S2: construct a target detection network based on a selective state space model, modify the loss function of the target detection network, introduce the Focal Loss loss function, and adjust the network hyperparameters through the validation set to optimize the training result of the target detection network;
[0034] S3: Inputting the infrared aerial image to be processed into the target detection network for target detection;
[0035] S4: Input the test set data into the trained target detection network based on the selective state space model, and evaluate the performance of the target detection network by combining multiple evaluation indicators.
[0036] Specifically, S1 includes the following steps:
[0037] Obtain a public infrared aerial image dataset, process the dataset, and obtain a YOLO format dataset with a total of 11,045 images; divide the dataset into training set, test set, and validation set in a ratio of 8:1:1, perform data enhancement on the dataset through the Mosaic module, and set the image input size to 512×512;
[0038] In step S2, the overall structure of the target detection network based on the selective state space model is constructed as follows: Figure 2As shown in the figure, the network adopts the backbone network, neck network and head network structure of the YOLOv8 framework. The backbone network is used to extract image features, the neck network is used to fuse the multi-scale features extracted by the backbone network, and the head network is used to further extract the multi-scale features;
[0039] The backbone network includes convolution blocks and C2f modules. Among them, a convolution block with a convolution kernel of 3 and a step size of 2 is used to downsample the feature map. Each downsampling reduces the size of the feature map to 1 / 2 of the original size. The C2f module is used to extract features from the feature map. The backbone network outputs feature maps with sizes of 8*8, 16*16, and 32*32 (later replaced by S5 feature maps, S4 feature maps, and S3 feature maps);
[0040] The neck network is a PAN structure. The backbone network output S5 feature map is interpolated and upsampled, and then spliced with the S4 feature map. The spliced feature map is then fused through the C2f module and upsampled and spliced with the S3 feature map. After that, the feature map is downsampled through the reverse operation and then spliced with the previous feature map of the same size. The neck network outputs S5*, S4*, and S3* feature maps that fuse multi-scale information.
[0041] The head network consists of three detection heads, each of which recognizes the S5*, S4*, and S3* feature maps respectively. Each detection head has two branches, each of which consists of two 3*3 convolutions and one 1*1 convolution, decoding the feature maps into classifications and anchor boxes.
[0042] The C2f module in the backbone network is improved, and the C2f extracted features are further processed using the attention module based on the selective state space model to obtain the C2f-Attention module. The structure diagram of the C2f-Attention module is shown in the figure. Figure 3 As shown in Figure 1, the C2f-Attention module is composed of a C2f module and an SSM-Attention module connected in series.
[0043] The schematic diagram of the SSM-Attention module structure is as follows Figure 4 As shown in the figure, the SSM-Attention module is composed of the SSM-Channel Attention module and the SSM-Channel Attention module. After the feature map enters the SSM-Attention module, the SSM-Channel Attention module first extracts the channel attention, and then passes the feature map of the mixed channel attention through the SSM-Channel Attention module to obtain the final output.
[0044] The SSM-Channel Attention module and the SSM-Spatial Attention module are implemented based on the SS1D and SS2D modules respectively. The SSM-Channel Attention module consists of an adaptive global pooling module, an SS1D module, and a Sigmoid function. The SSM-Spatial Attention module consists of an SS2D module and a Sigmoid function.
[0045] The SSM-Channel Attention module is defined as follows:
[0046] f′ c =f×σ(SS1D(AVG(f)))
[0047] In the above formula, f, f′ c ∈R[B,W,H,C] represents the input and output feature maps respectively, AVG(·) represents the global average pooling operation, SS1D(·) represents the bidirectional selective state scanning, and σ(·) represents the Sigmoid function.
[0048] The SSM-Spatial Attention module is defined as follows:
[0049] f′ s =f×σ(SS2D(Concat(f avg ,f max )))
[0050] In the above formula, f, f′ s ∈R[B,W,H,C] represents the input and output feature maps respectively, f avg , f max ∈R[B,W,H,1] represents the feature map after averaging and max pooling operations are performed on the feature map in the channel dimension, Concact(·) represents the concatenation of feature maps along the channel dimension, SS2D(·) represents the cross selective state scanning, and σ(·) represents the Sigmoid function.
[0051] The SS1D module and SS2D module are defined as follows:
[0052] x 1D =Concat(x,flip(x))
[0053] x 2D =Concat(x′,flip(x′),x т′ ,flip(x т′ ))
[0054] In the above formula, x∈R[B,L,D], x′∈[B,H×W,D], B represents BatchSize, L represents sequence length, D represents dimension, H represents image height, H represents image width, flip(·) represents flipping L, and x т′ Indicates transposing the image. X 1D ∈[B,2,L,D] represents the input of SS1D module, x 2D ∈[B,4,L,D] represents the input of the SS2D module.
[0055] Δ,B,C=Linear(x iD ),Linear(x iD ),Linear(x iD )
[0056]
[0057]
[0058]
[0059]
[0060]
[0061] y=∑unflip(y iD )
[0062] In the above formula, Δ∈R[B,2i,L,N] represents the discretization parameter, B, C∈R[B,2i,L,N] represents the learnable matrix. Linear(·) represents the linear transformation function, A∈R[2i,D,N], represents the matrix after discretization operation, x iD ∈R[B,2i,L,N] represents the input, h t represents the state matrix, y iD ∈R[B,2i,L,N] represents the results of different scanning directions, unflip(·) represents the function of restoring the direction to the original direction, and y∈R[B,L,N] represents the output after adding the results of scanning in different directions;
[0063] The feature aggregation-distribution structure is introduced into the neck network. The schematic diagram of the feature aggregation-distribution structure is as follows: Figure 5 As shown in FIG. 1 , the features extracted by the backbone network are fused, and then uniformly processed by the selective state space feature extraction block VSS Block, and then the features are restored to the original scale features;
[0064] First, the S3 feature map, S4 feature map, and S5 feature map extracted by the backbone network are aggregated into feature maps of uniform size. The feature aggregation module is defined as follows:
[0065] f input =Conv 1×1 (Concat(Upsampling(S5),S4,Maxpooling(S3)))
[0066] In the above formula, f input ∈R[B,16,16,C] represents the output of the feature aggregation module, Conv 1×1 (·) represents 1×1 convolution, Concat(·) represents concatenation of channel dimension, Upsampling(·) represents difference upsampling, Maxpooling(·) represents maximum pooling, S3∈R[B,32,32,C], S4∈R[B,16,16,C], S5∈R[B,8,8,C] represent feature maps extracted by backbone network respectively;
[0067] Afterwards, a long-distance semantic feature extraction module is constructed, and the VSS Block module is used as the long-distance semantic feature extraction module. The VSS Block consists of a linear transformation layer, a depthwise separable convolution, a SiLU activation function, a normalization layer, and an SS2D module. After entering the VSS Block, the feature map is first processed by the normalization layer, and then a linear transformation is performed to map its dimension to an intermediate dimension, and then the feature is extracted through a depthwise separable convolution. After that, the SS2D module scans the feature, normalizes the scanned feature again, multiplies it with the feature before the linear transformation, and then maps the intermediate dimension to the output dimension, and finally performs a residual connection with the input;
[0068] Finally, construct the feature distribution module. The feature distribution module is the reverse operation of the feature aggregation module. Its purpose is to restore the aggregated feature map to the original size feature map to enter the head network. The feature distribution module is defined as follows:
[0069] S5 * =Maxpool(f′)
[0070] S4 * =f′
[0071] S3 * =Upsampling(f′)
[0072] In the above formula, S3 * ∈R[B,32,32,C],S4 * ∈R[B,16,16,C],S5 *∈R[B,8,8,C] is the output of the feature distribution module. f′ is the feature map after feature extraction by the long-distance semantic feature extraction module;
[0073] Modify the network loss function, introduce the Focal Loss loss function to address the problem of uneven sample distribution, and define the overall network loss function as follows:
[0074] L det =α1L cls +α2L iou +α3L conf
[0075] In the above formula, L det Represents the loss of target detection results, L cls represents the classification loss, L iou represents the IOU loss, L conf represents the confidence loss. α1, α2, and α3 are weight parameters respectively.
[0076] The sample distribution image of the output data set is as follows Figure 7 As shown in the figure, for the sample distribution analysis, the Focal loss function is introduced as the classification loss to address the problem of uneven distribution of sample types. The Focal Loss is defined as follows:
[0077]
[0078] in, Indicates whether there is an object in the jth bbox in grid i, γ is an adjustable parameter, ∝ is a weight parameter, which is 1 if it exists and 0 otherwise, p t represents the true and predicted probability that the grid is classified as t.
[0079] The confidence loss function is defined as follows:
[0080]
[0081] Among them, C i Indicates the confidence of the prediction, C′ i Represents the IoU between the predicted box and the real box, Indicates whether there is a target in the jth bbox in grid i, if so, it is 1, otherwise it is 0;
[0082] The IOU loss function is defined as follows:
[0083]
[0084] Among them, B represents the prediction box, B gtrepresents the true box, ρ is the distance between the center points of the predicted box and the true box, c is the diagonal length of the minimum enclosing rectangle of the two, α is a balance factor that weighs the loss caused by the aspect ratio and the loss caused by the IoU part, and v is the normalized difference between the aspect ratio of the predicted box and the true box.
[0085] Set the initial epoch to 150, use the SGD optimizer, set the learning rate to 0.01, set the BatchSize size according to the experimental environment, the training GPU is GTX1080, the video memory is 8G, so the training BatchSize is set to 8, and draw the loss function curve during the training process; according to the loss function curve, the training loss converges at epoch=80, and the subsequent training epoch is set to 80; train the model multiple times, and take the model with the best validation set index as the final model;
[0086] The test set images are input into the trained target detection network based on the selective state space model to obtain the detection results after NMS processing, such as Figure 6 As shown in the figure, it can be clearly seen from the visualization results that the network has a good effect on infrared target detection, with few missed targets, and can accurately identify various targets. The performance of the network is evaluated by combining indicators such as mAP50, mAP50:95, and parameter quantity. The definition of mAP is as follows:
[0087]
[0088] In the above formula, AP i represents the average accuracy of the model for the i-th category, and N is the total number of training categories.
[0089] The method of the present invention is based on the YOLO algorithm and the SSM algorithm, and realizes the accurate detection of infrared aerial photography targets. Through practical application, it shows good recognition effect for various targets in the aerial photography pictures.
Claims
1. A selective state space model infrared aerial target detection method, characterized in that The steps include: S1: Obtain an infrared aerial image dataset, process the dataset to obtain a dataset in YOLO format, and divide the dataset into a training set, a test set, and a validation set; S2: construct a target detection network based on a selective state space model, modify the loss function of the target detection network, introduce the Focal Loss loss function, and adjust the network hyperparameters through the validation set to optimize the training result of the target detection network; S3: Input the infrared aerial images in the test set into the target detection network for target detection, and evaluate the network performance in combination with the evaluation index; The target detection network adopts the backbone network, neck network and head network structure of the YOLO framework; the backbone network is used to extract image features respectively, and the neck network is used to fuse the backbone network to extract multi-scale features, and the head network is used to further extract the multi-scale features; the C2f module in the backbone network is improved, and the C2f extracted features are further processed using an attention module based on a selective state space model to obtain a C2f-Attention module; A feature aggregation-distribution structure is introduced into the neck network. The features extracted by the backbone network are fused and then processed uniformly by the feature extraction block VSS Block based on the selective state space model, and then restored to the original scale features. The improvement of the C2f module in the backbone network specifically includes the following steps: 1) Construct SS1D module and SS2D module based on selective state space model. The definitions of SS1D module and SS2D module are as follows: x 1D =Concat(x,flip(x)) x 2D =Concat(x′,flip(x′),x т′ ,flip(x т′ )) In the above formula, x∈R[B',L,D], x'∈[B',H×W,D], B' represents BatchSize, L represents the sequence length, D represents the dimension, H represents the image height, W represents the image width, flip(·) represents flipping L, and x т′ Indicates transposing the image; x 1D ∈[B',2,L,D] represents the input of SS1D module, x 2D ∈[B',4,L,D] represents the input of the SS2D module; Δ,B,C=Linear(x iD ),Linear(x iD ),Linear(x iD ) y=∑unflip(y iD ) In the above formula, Δ∈R[B',2i,L,C'] represents the discretization parameter, B, C∈R[B',2i,L,C'] represents the learnable matrix; Linear(·) represents the linear transformation function, A∈R[2i,D,C'], represents the matrix after discretization operation, x iD ∈R[B',2i,L,C'] represents the input, h t represents the state matrix, exp(·) represents the exponential function, y iD ∈R[B',2i,L,C'] represents the results of different scanning directions, unflip(·) represents the function of restoring the direction to the original direction, and y∈R[B',L,C'] represents the output after adding the results of scanning in different directions; 2) Construct the SSM-ChannelAttention module based on the SS1D module; The SSM-Channel Attention module is proposed based on the selective state space model. The feature map is first converted into a 1D vector through a global average pooling layer. Then, the SS1D module with bidirectional scanning capability performs bidirectional scanning on the 1D vector to fully integrate the information between channels. The 1D vector after scanning is then sigmoided and converted into a channel weight, which is then multiplied with the input feature map. The SSM-Channel Attention module consists of an adaptive global pooling module, an SS1D module, and a Sigmoid function. The SSM-Channel Attention module is defined as follows: f′ c =f×σ(SS1D(AVG(f))) In the above formula, f, f′ c ∈R[B',W,H,C'] represents the input and output feature maps respectively, AVG(·) represents the global average pooling operation, SS1D(·) represents the bidirectional selective state scanning, and σ(·) represents the Sigmoid function; 3) Construct the SSM-SpatialAttention module based on the SS2D module; The SSM-Spatial Attention module is proposed based on the selective state space model. First, the feature map is average pooled and max pooled in the spatial dimension, and then the pooled feature maps are spliced. The pooled feature map is input into the SS2D module with four scanning directions. The SS2D module scans the feature map from top to bottom and from left to right, respectively, so that each pixel can fully integrate the long-distance information. The spatial information is converted into spatial weights through the Sigmoid function, and then a 1*1 convolution is used to compress the number of channels to 1. Finally, it is spliced with the input feature map. The SSM-Spatial Attention module includes the SS2D module and the Sigmoid function; the SSM-Spatial Attention module is defined as follows: f′ s =f×σ(SS2D(Concat(f avg ,f max ))) In the above formula, f, f′ s ∈R[B',W,H,C'] represents the input and output feature maps respectively, f avg , f max ∈R[B',W,H,1] represents the feature map after averaging and max pooling operations are performed on the feature map in the channel dimension, Concact(·) represents the concatenation of feature maps along the channel dimension, SS2D(·) represents the cross-selective state scan, and σ(·) represents the Sigmoid function; 4) Construct the SSM Attention module based on the SSM-Channel Attention module and the SSM-Spatial Attention module. The SSM Attention module is defined as follows: f′=f×f′ s (f×f′ c ) In the above formula, f ′ represents the feature map after the long-distance semantic feature extraction module extracts features, f′ s , f′ c They represent the feature maps output after the input feature map f passes through the SSM-Channel Attention module and the SSM-Spatial Attention module respectively; 5) Construct a C2f-Attention module based on the SSM Attention module. The construction process is to place the SSM Attention module after the C2f module.
2. The infrared aerial target detection method of the selective state space model according to claim 1, characterized in that: The step S1 specifically includes the following steps: S11, obtain the infrared aerial photography target data set from the network, and convert the initial VOC format data set into a YOLO format data set; S12, dividing the converted data set into a training set, a test set, and a validation set in a ratio of 8:1:1; S13, before inputting into the network training, the data is enhanced through the Mosaic module.
3. The infrared aerial target detection method of the selective state space model as claimed in claim 1, characterized in that: The backbone network includes a convolution block and a C2f module, wherein a convolution block with a convolution kernel of 3 and a step size of 2 is used to downsample the feature map, and each downsampling reduces the size of the feature map to 1 / 2 of the original size. The C2f module is used to extract features from the feature map, and the backbone network outputs feature maps with sizes of 8*8, 16*16, and 32*32, which are referred to as S5 feature maps, S4 feature maps, and S3 feature maps, respectively. The neck network is a PAN structure. The S5 feature map output by the backbone network is interpolated and upsampled, and then spliced with the S4 feature map. The spliced feature map is then fused through the C2f module and upsampled and spliced with the S3 feature map. After that, the feature map is downsampled through the reverse operation and then spliced with the previous feature map of the same size. The neck network outputs the S5* feature map, S4* feature map, and S3* feature map that fuse multi-scale information. The head network consists of three detection heads, each of which recognizes the S5* feature map, S4* feature map and S3* feature map respectively. Each detection head has two branches, each of which includes two 3*3 convolutions and one 1*1 convolution to decode the feature map into classification and anchor boxes.
4. The infrared aerial target detection method of the selective state space model as claimed in claim 1, characterized in that: The method for constructing the feature aggregation-distribution structure comprises the following steps: 1) Construct a feature aggregation module. The feature aggregation module aggregates the S3 feature map, S4 feature map, and S5 feature map extracted by the backbone network into a feature map of uniform scale. The feature aggregation module is defined as follows: f input =Conv 1×1 (Concat(Upsampling(S5),S4,Maxpooling(S3))) In the above formula, f input ∈R[B',16,16,C'] represents the output of the feature aggregation module, Conv 1×1 (·) represents 1×1 convolution, Concat(·) represents concatenation of channel dimensions, Upsampling(·) represents difference upsampling, Maxpooling(·) represents maximum pooling, S3∈R[B',32,32,C'], S4∈R[B',16,16,C'], S5∈R[B',8,8,C'] represent feature maps extracted by the backbone network respectively; 2) Construct a long-distance semantic feature extraction module and use the VSS Block module as the long-distance semantic feature extraction module; VSS Block includes linear transformation layer, depthwise separable convolution, SiLU activation function, normalization layer and SS2D module. After entering VSS Block, the feature map is first processed by the normalization layer, then linearly transformed, and its dimension is mapped to the intermediate dimension. Then, the feature is extracted by depthwise separable convolution. After that, the SS2D module scans the feature, normalizes the scanned feature again, multiplies it with the feature before linear transformation, maps the intermediate dimension to the output dimension, and finally performs residual connection with the input. 3) Construct a feature distribution module. The feature distribution module is the reverse operation of the feature aggregation module. Its purpose is to restore the aggregated feature map to the original size feature map to enter the head network. The feature distribution module is defined as follows: S5 * =Maxpool(f′) S4 * =f′ S3 * =Upsampling(f′) In the above formula, S3 * ∈R[B',32,32,C'], S4 * ∈R[B',16,16,C'],S5 * ∈R[B′,8,8,C′] is the output of the feature distribution module, and f′ is the feature map after feature extraction by the long-distance semantic feature extraction module.
5. The infrared aerial target detection method of the selective state space model as claimed in claim 3, characterized in that: The network loss function is constructed as follows: 1) Output the sample distribution image of the data set and analyze the sample distribution; 2) The confidence loss function is defined as follows: Among them, C i Indicates the confidence of the prediction, C′ i Represents the IoU between the predicted box and the real box, Indicates whether there is a target in the jth bbox in grid i, if so, it is 1, otherwise it is 0; 3) To address the problem of uneven sample distribution, the classification loss function uses Focal Loss and is defined as follows: in, Indicates whether there is an object in the jth bbox in grid i. If so, it is 1, otherwise it is 0. γ is an adjustable parameter. t is the weight parameter, p t represents the true and predicted probability that the grid is classified as t; 4) The IOU loss function is defined as follows: Among them, B pred represents the prediction box, B gt represents the true box, ρ is the distance between the center points of the predicted box and the true box, c is the diagonal length of the minimum enclosing rectangle of the two, α is the balance factor that weighs the loss caused by the aspect ratio and the loss caused by the IoU part, and v is the normalized difference between the aspect ratio of the predicted box and the true box; 5) The overall network loss function is defined as follows: L det =α1L cls +α2L iou +α3L conf In the above formula, L det Represents the loss of target detection results, L cls represents the classification loss, L iou represents the IOU loss, L conf represents the confidence loss, and α1, α2, and α3 are weight parameters respectively.
6. The infrared aerial target detection method of the selective state space model as claimed in claim 3, characterized in that: The method for adjusting the network hyperparameters comprises the following steps: 1) Set the initial epoch to 150, use the SGD optimizer, set the learning rate to 0.01, set the BatchSize size according to the experimental environment, set the training GPU to GTX1080, the video memory to 8G, set the training BatchSize to 8, and draw the loss function curve during the training process; 2) According to the loss function curve, the training loss converges at epoch=80, and the subsequent training epoch is set to 80; 3) Train the model multiple times and take the model with the best validation set index as the final model.
7. The infrared aerial target detection method of the selective state space model according to claim 1, characterized in that: The method further comprises: The test set data is input into the trained target detection network based on the selective state space model, and the redundant information is filtered through the NMS algorithm to obtain the network prediction result. The detection result is plotted on the image, and the performance of the target detection network is evaluated by combining multiple evaluation indicators.
8. The infrared aerial target detection method of the selective state space model as claimed in claim 7, characterized in that: mAP50 and mAP50:95 as well as the number of parameters are used as evaluation indicators. The definition of mAP is as follows: In the above formula, AP i represents the average accuracy of the model for the i-th category, and N' is the total training category.
Citation Information
Patent Citations
Improved YOLOv8 unmanned aerial vehicle aerial target detection method
CN117557922A