Small target detection method, device, equipment and storage medium
By introducing multiple LSKNet large convolutional kernel hybrid domain attention mechanism modules and MLLA attention mechanism modules into remote sensing images, multi-scale spatial context feature extraction and model training are performed on remote sensing images, solving the problem of low efficiency and accuracy in small target detection in remote sensing images, and achieving efficient and accurate detection results.
Patent Information
- Application Number
- CN202411839259.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2044-12-13
AI Technical Summary
Existing technologies are inefficient and inaccurate in detecting small targets in remote sensing images, making it difficult to perform detection efficiently and accurately.
A multi-scale spatial context feature extraction method based on YOLOv8 and multiple LSKNet large convolutional kernels is used to extract features from remote sensing images. The initial small target detection model is trained by combining the MLLA attention mechanism module. The model parameters are updated by multi-scale spatial context features and detection result labels.
It improves the detection efficiency and accuracy of small targets in remote sensing images, effectively captures and utilizes the spatial context information of remote sensing images, and enhances the feature representation ability of complex scenes and rotating small targets.
Smart Images

Figure CN119851149B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of target detection technology, and in particular to a method, apparatus, device and storage medium for small target detection. Background Technology
[0002] With the rapid development of remote sensing technology, high-resolution remote sensing images have shown great application potential in many fields such as environmental monitoring, urban planning, and disaster assessment. However, given that small targets in remote sensing images, especially rotated small targets, are typically characterized by varying scales, complex shapes, dense distribution, and strong background interference, small target detection in remote sensing images remains a major challenge in the field of computer vision.
[0003] However, considering that traditional target detection algorithms often suffer from low detection efficiency and low detection accuracy when detecting small targets in remote sensing images, how to efficiently and accurately detect small targets in remote sensing images is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for small target detection, which addresses the shortcomings of existing technologies in efficiently and accurately detecting small targets in remote sensing images, thereby improving the detection efficiency and accuracy of small targets in remote sensing images.
[0005] This application provides a method for small target detection, including:
[0006] Acquire a remote sensing image of the target to be processed, wherein the remote sensing image of the target includes small targets to be detected;
[0007] The target remote sensing image is input into the small target detection model to obtain the detection result of the small target output by the small target detection model;
[0008] The small target detection model is obtained by introducing multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules in YOLOv8 to extract multi-scale spatial context features from remote sensing images in the training dataset, and training the initial small target detection model based on the multi-scale spatial context features and the detection result labels corresponding to the remote sensing images.
[0009] According to the small object detection method provided in this application, the initial small object detection model includes an initial feature extraction module and three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules connected in series, a feature fusion module connected to the three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules, and a first MLLA attention mechanism module, a second MLLA attention mechanism module and a third MLLA attention mechanism module connected to the feature fusion module.
[0010] The small target detection model is trained in the following manner:
[0011] The remote sensing image is input into the initial feature extraction module, and the initial features of the remote sensing image are extracted by the initial feature extraction module;
[0012] The initial features are input into the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, and the first scale spatial context features are obtained through the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module.
[0013] Based on the first scale spatial context features and the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, the second scale spatial context features are obtained.
[0014] Based on the second-scale spatial context features and the third LSKNet-based large convolutional kernel hybrid domain attention mechanism module, the third-scale spatial context features are obtained.
[0015] The first scale spatial context features, the second scale spatial context features, and the third scale spatial context features are input into the feature fusion module, and the corresponding first scale splicing features, second scale splicing features, and third scale splicing features are obtained through the feature fusion module.
[0016] The first scale splicing feature is input into the first MLLA attention mechanism module to obtain the first scale key feature; the second scale splicing feature is input into the second MLLA attention mechanism module to obtain the second scale key feature; and the third scale splicing feature is input into the third MLLA attention mechanism module to obtain the third scale key feature.
[0017] Based on the first-scale key features, the second-scale key features, the third-scale key features, and the detection result labels, the model parameters of the initial small target detection model are updated to obtain the small target detection model.
[0018] According to a small target detection method provided in this application, the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module is followed by a convolutional layer and a transformation layer in sequence.
[0019] The second-scale spatial context features, obtained based on the first-scale spatial context features and the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, include:
[0020] The first scale spatial context features are input into the convolutional layer, and the convolutional scale spatial context features are output through the convolutional layer.
[0021] The convolutional scale spatial context features are input into the transformation layer, and the transformation scale spatial context features are output through the transformation layer.
[0022] The transformed scale spatial context features are input into the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, and the second scale spatial context features are obtained through the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module.
[0023] According to the small target detection method provided in this application, the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module includes multiple depthwise separable convolutional layers connected in series and a spatial selection layer connected to the multiple depthwise separable convolutional layers;
[0024] The step of inputting the initial features into the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, and obtaining the first scale spatial context features through the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, includes:
[0025] The initial features are sequentially input into multiple depthwise separable convolutional layers, and the corresponding depthwise separable features are output by the multiple depthwise separable convolutional layers respectively;
[0026] Multiple depthwise convolutional separable features are input into the spatial selection layer, and the spatial selection layer outputs the first-scale spatial context features.
[0027] According to the small target detection method provided in this application, the step of inputting multiple depthwise convolutional separable features into the spatial selection layer, and outputting the first-scale spatial context features through the spatial selection layer, includes:
[0028] Multiple depthwise convolutional separable features are input into the spatial selection layer, and the spatial selection layer performs a concatenation process on the multiple depthwise convolutional separable features to obtain a depthwise convolutional separable concatenated feature.
[0029] The depthwise convolutional separable and spliced features are pooled using average pooling and max pooling based on the channels, respectively, to obtain the average pooling spatial feature description and the max pooling spatial feature description.
[0030] The concatenated features of the average pooling spatial feature description and the max pooling spatial feature description are transformed to obtain multiple spatial attention maps;
[0031] Based on the spatial selection mask corresponding to each of the spatial attention maps, the multiple spatial attention maps are weighted and fused to obtain attention features; wherein, the spatial selection mask corresponding to each spatial attention map is used to characterize the importance of the spatial region corresponding to the spatial attention map in the remote sensing image;
[0032] The attention features are multiplied element-wise with the initial features to obtain the first scale spatial context features.
[0033] According to the small target detection method provided in this application, the step of updating the model parameters of the initial small target detection model based on the first-scale key features, the second-scale key features, the third-scale key features, and the detection result label includes:
[0034] Based on the first-scale key features, the second-scale key features, and the third-scale key features, the first detection result of the initial small target detection model for the remote sensing image is determined.
[0035] Obtain the second detection result of the teacher model for the remote sensing image;
[0036] Based on the second detection result of the teacher model in the first activation map of a specific channel, determine the first KL divergence corresponding to the first activation map, and based on the first detection result of the initial small target detection model in the second activation map of the specific channel, determine the second KL divergence corresponding to the second activation map;
[0037] Based on the difference between the first detection result and the detection result label, the first KL divergence and the second KL divergence are used to update the model parameters of the initial small target detection model.
[0038] This application also provides a small target detection device, including:
[0039] An acquisition unit is used to acquire a remote sensing image of a target to be processed, wherein the remote sensing image of the target includes small targets to be detected;
[0040] The detection unit is used to input the remote sensing image of the target into the small target detection model and obtain the detection result of the small target output by the small target detection model;
[0041] The small target detection model is obtained by introducing multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules in YOLOv8 to extract multi-scale spatial context features from remote sensing images in the training dataset, and training the initial small target detection model based on the multi-scale spatial context features and the detection result labels corresponding to the remote sensing images.
[0042] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the small target detection method as described above.
[0043] This application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the small target detection method as described above.
[0044] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the small target detection method as described above.
[0045] The small target detection method, apparatus, device, and storage medium provided in this application can first acquire a remote sensing image of the target to be processed, which includes the small target to be detected; input the remote sensing image of the target into a small target detection model to obtain the detection result of the small target output by the small target detection model; wherein, the small target detection model is based on YOLOv8 and introduces multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules to extract multi-scale spatial context features from the remote sensing images in the training dataset, and trains the initial small target detection model based on the multi-scale spatial context features and the detection result labels corresponding to the remote sensing images. Given that small target detection models have good multi-scale spatial context feature extraction capabilities, they can effectively capture and utilize the spatial context information of remote sensing images. Therefore, when the target remote sensing image to be processed is input into the small target detection model, and the model detects small targets in the target remote sensing image, it can effectively capture and utilize the spatial context information of the target remote sensing image. In this way, by combining the spatial context information of the target remote sensing image, small targets in remote sensing images can be detected efficiently and accurately, thereby improving the detection efficiency and accuracy of small targets in remote sensing images. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a flowchart illustrating a small target detection method provided in an embodiment of this application.
[0048] Figure 2 This is a schematic diagram of the structure of an initial small target detection model provided in an embodiment of this application.
[0049] Figure 3 This is a flowchart illustrating a training method for a small target detection model provided in an embodiment of this application.
[0050] Figure 4 This is a schematic diagram of the structure of a large convolutional kernel hybrid domain attention mechanism unit provided in an embodiment of this application.
[0051] Figure 5 This is a schematic diagram of a small target detection device provided in an embodiment of this application.
[0052] Figure 6 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0054] In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone, where A and B can be singular or plural. In the textual description of this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0055] The technical solutions provided in this application can be adapted to scenarios such as target detection. Given that small targets in remote sensing images, especially rotated small targets, typically exhibit characteristics such as variable scale, complex shape, dense distribution, and strong background interference, small target detection in remote sensing images remains a significant challenge in the field of computer vision.
[0056] To efficiently and accurately detect small targets in remote sensing images, this application provides a method for small target detection. It pre-introduces multiple large convolutional kernel hybrid domain attention mechanism modules based on LSKNet (Large Selective Kernel Network) using YOLOv8 to extract multi-scale spatial context features from remote sensing images in the training dataset. Based on these multi-scale spatial context features and the corresponding detection result labels of the remote sensing images, an initial small target detection model is trained to obtain the final small target detection model. Given that the small target detection model has good multi-scale spatial context feature extraction capabilities and can effectively capture and utilize the spatial context information of remote sensing images, when the target remote sensing image to be processed is input into the small target detection model, the spatial context information of the target remote sensing image can be effectively captured and utilized. This combination of spatial context information allows for efficient and accurate detection of small targets in remote sensing images, thereby improving the detection efficiency and accuracy.
[0057] It is understood that the subject of this method can be an electronic device such as a small target detection device, a computer or server, or a small target detection device installed in such an electronic device. The small target detection device can be implemented by software, hardware or a combination of both, and can be set according to actual needs.
[0058] The small target detection method provided in this application will be described in detail below through several specific embodiments. It is understood that these specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0059] Figure 1 This is a flowchart illustrating a small target detection method provided in an embodiment of this application. For example, please refer to [link to flowchart illustration]. Figure 1 As shown, this small target detection method may include:
[0060] S101. Obtain the target remote sensing image to be processed, which includes small targets to be detected.
[0061] Small targets typically refer to objects that occupy a small area or have a small size in remote sensing images. Understandably, the definition of these objects can vary depending on different standards and datasets, and can be set according to actual needs. For example, small targets can include vehicles, pedestrians, buildings, aircraft, and ships.
[0062] For example, the target remote sensing image can be obtained from satellite images or drone images; of course, it can also be obtained from satellite images and drone images respectively, and then the acquired satellite images and drone images can be fused together to obtain the remote sensing image. The specific settings can be configured according to actual needs.
[0063] For example, the target remote sensing image to be processed can be obtained by on-site shooting, from a network media library, or through other means, such as from a public database. The specific settings can be configured according to actual needs.
[0064] Normally, after acquiring the remote sensing image of the target to be processed, if the image quality of the remote sensing image is good, the remote sensing image of the target can be directly input into the small target detection model, that is, the following S102 is executed; conversely, if the image quality of the remote sensing image of the target is poor, the remote sensing image of the target can be preprocessed first, such as denoising, radiometric correction, geometric correction, atmospheric correction, etc., and the preprocessed remote sensing image of the target can be input into the small target detection model, that is, the following S102 is executed.
[0065] S102. Input the target remote sensing image into the small target detection model to obtain the detection results of the small target output by the small target detection model.
[0066] The small target detection model is based on YOLOv8, which introduces multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules to extract multi-scale spatial context features from remote sensing images in the training dataset. The initial small target detection model is then trained based on the multi-scale spatial context features and the detection result labels corresponding to the remote sensing images.
[0067] It is understood that, in the embodiments of this application, the large convolutional kernel hybrid domain attention mechanism module based on LSKNet aims to construct convolutional operations with large receptive fields by explicitly decomposing them. This can decompose large kernel convolutions into a series of depth-separable convolutions, whose kernel size and dilation rate gradually increase, thereby ensuring rapid expansion of the receptive field.
[0068] In the decomposition process, for the i-th depthwise separable convolution in the sequence, the kernel size k, dilation rate d, and expansion method of the receptive field RF are defined, as shown in Equations 1 and 2 below. By gradually increasing the kernel size and dilation rate, it can be ensured that the receptive field grows at a sufficient rate to capture a wider range of spatial context information. At the same time, in order to avoid unnecessary gaps (i.e., holes) between feature maps, an upper limit can be set for the dilation rate.
[0069] Formula 1
[0070] Formula 2
[0071] in, This represents the kernel size of the i-th depthwise separable convolution. This represents the dilation rate of the i-th depthwise separable convolution. This represents the receptive field of the i-th depthwise separable convolution.
[0072] To extract different range features with rich spatial context information from the input target remote sensing image, a series of decomposed depthwise separable convolutions with different receptive fields can be employed. Each convolution kernel... and expansion rate Each combination corresponds to a depthwise separable convolution operation, and each large convolutional kernel hybrid domain attention mechanism unit in the large convolutional kernel hybrid domain attention mechanism module is processed by a 1×1 convolutional layer to achieve cross-channel information mixing.
[0073] This approach, based on YOLOv8, introduces multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules for multi-scale spatial context feature extraction. By automatically capturing and utilizing the spatial context information of remote sensing images through the attention mechanism, it can not only explicitly generate multiple features with different receptive fields, providing a rich candidate set for subsequent kernel selection, but also enable the trained small object detection model to more flexibly handle input data of different ranges. This effectively enhances the small object detection model's feature representation ability for complex scenes and rotated small objects, thereby improving detection accuracy. Furthermore, compared to single-scale spatial context feature extraction, under the condition of achieving the same theoretical receptive field, the large kernel convolution decomposition method provided in this application significantly reduces the number of parameters and lowers computational costs.
[0074] As can be seen, in this embodiment of the application, when performing small target detection, the target remote sensing image to be processed can be acquired first, and the target remote sensing image includes the small target to be detected; the target remote sensing image is input into the small target detection model to obtain the small target detection result output by the small target detection model; wherein, the small target detection model is based on YOLOv8 and introduces multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules to extract multi-scale spatial context features from the remote sensing images in the training dataset, and the initial small target detection model is trained based on the multi-scale spatial context features and the detection result labels corresponding to the remote sensing images. Given that small target detection models have good multi-scale spatial context feature extraction capabilities, they can effectively capture and utilize the spatial context information of remote sensing images. Therefore, when the target remote sensing image to be processed is input into the small target detection model, and the model detects small targets in the target remote sensing image, it can effectively capture and utilize the spatial context information of the target remote sensing image. In this way, by combining the spatial context information of the target remote sensing image, small targets in remote sensing images can be detected efficiently and accurately, thereby improving the detection efficiency and accuracy of small targets in remote sensing images.
[0075] For example, the initial small object detection model described above can be improved using a YOLOv8 rotating object detection network. This can be achieved by introducing three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules into the YOLOv8 backbone network, and three MLLA attention mechanism modules into the Neck part. For example, see [link to example]. Figure 2 As shown, Figure 2 This is a schematic diagram of the structure of an initial small object detection model provided in an embodiment of this application. The initial small object detection model may include an initial feature extraction module and three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules connected in series, a feature fusion module connected to the three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules, and a first MLLA attention mechanism module, a second MLLA attention mechanism module, and a third MLLA attention mechanism module connected to the feature fusion module. To facilitate understanding of how the initial small object detection model is trained in this embodiment of the application to obtain the small object detection model, the following will explain... Figure 3 The illustrated embodiment describes the training method for a small target detection model.
[0076] It is understood that the MLLA attention mechanism module is employed in this embodiment for the following reasons: First, the forget gate in the MLLA attention mechanism module provides local bias and positional information. All forget gate elements are strictly limited to between 0 and 1, meaning that the model continuously decays previous hidden states after receiving the current input. This characteristic ensures that the initial small object detection model is sensitive to the order of inputs, which helps to handle local bias and positional information. Second, the linear attention mechanism in the MLLA attention mechanism module is redesigned to integrate the forget gate and the design module, giving it good performance in remote sensing image classification and high-resolution dense prediction tasks such as dense small object detection. Furthermore, the MLLA attention mechanism module has parallel computing and fast inference capabilities. In this embodiment, positional encoding is used instead of the forget gate, thereby providing the necessary positional information while maintaining parallel computing and fast inference speed, making the MLLA attention mechanism module more effective in handling non-autoregressive visual tasks. This not only improves the ability of the trained small target detection model to capture target location information, but also promotes more accurate positional visual understanding. In addition, it solves some of its limitations in parallel computing, making it suitable for small target detection tasks and thus improving the detection accuracy of small targets.
[0077] Figure 3 This application provides a flowchart illustrating a training method for a small target detection model. For example, please refer to... Figure 3 As shown, the training method for this small object detection model may include:
[0078] S301. Input the remote sensing image into the initial feature extraction module, and extract the initial features of the remote sensing image through the initial feature extraction module.
[0079] For example, the remote sensing image can be a FAIR1M image sample.
[0080] For example, remote sensing images can be acquired through on-site photography, from online media libraries, or through other methods, such as from public databases. The specific settings can be configured according to actual needs.
[0081] Typically, after acquiring a remote sensing image, if the image quality is good, only its resolution needs to be adjusted to meet the input requirements of the initial feature extraction module. The processed remote sensing image is then input into the initial feature extraction module to extract the initial features of the remote sensing image. Conversely, if the image quality is poor, the remote sensing image can be preprocessed first, such as through denoising, radiometric correction, geometric correction, and atmospheric correction. The resolution of the preprocessed remote sensing image is then adjusted to meet the input requirements of the initial feature extraction module, and the processed remote sensing image is then input into the initial feature extraction module to extract the initial features of the remote sensing image.
[0082] For example, see Figure 2 As shown in the embodiments of this application, the initial feature extraction module may include two convolutional layers Conv, a transformation layer C2f, and a convolutional layer Conv and a transformation layer C2f connected in series.
[0083] S302. Input the initial features into the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module to obtain the first scale spatial context features.
[0084] For example, in the embodiments of this application, see... Figure 4 As shown, Figure 4 This is a schematic diagram of the structure of the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module provided in this application embodiment. The first LSKNet-based large convolutional kernel hybrid domain attention mechanism module includes multiple depthwise separable convolutional layers connected in series and a spatial selection layer connected to the multiple depthwise separable convolutional layers. The depthwise separable convolutional layers are Large K.
[0085] By employing the spatial selection mechanism of LSKNet, spatial context features can be extracted from large convolutional kernels of different scales and spatial selection can be performed. This allows for the capture of important spatial context information at different scales, and the focus on key regions can be achieved through the attention mechanism, thereby improving the accuracy and efficiency of target detection.
[0086] Combination Figure 4The first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, shown in the diagram, inputs the initial features into the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module. When obtaining the first-scale spatial context features through the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, the initial features can be sequentially input into multiple depthwise separable convolutional layers, and the corresponding depthwise separable features can be output by the multiple depthwise separable convolutional layers respectively; and the multiple depthwise separable features are all input into the spatial selection layer, and the first-scale spatial context features are output by the spatial selection layer.
[0087] For example, in this embodiment of the application, when multiple deep convolutional separable features are input into a spatial selection layer and the first-scale spatial context features are output through the spatial selection layer, multiple deep convolutional separable features can be input into the spatial selection layer first. The spatial selection layer then concatenates the multiple deep convolutional separable features to obtain deep convolutional separable concatenated features. Average pooling and max pooling based on channels are then applied to the deep convolutional separable concatenated features to obtain average pooling spatial feature descriptions and max pooling spatial feature descriptions. These pooling spatial feature descriptions capture important spatial structure information in the features and can efficiently extract the spatial relationships between these features. The average pooling spatial feature descriptions and max pooling spatial feature descriptions are then processed... The spliced features are transformed to obtain multiple spatial attention maps, where different spatial attention maps represent the importance of different spatial regions. Based on the spatial selection mask corresponding to each spatial attention map, the multiple spatial attention maps are weighted and fused to obtain attention features, which can emphasize important spatial regions and suppress unimportant regions. The spatial selection mask corresponding to the spatial attention map is used to characterize the importance of the spatial region corresponding to the spatial attention map in the remote sensing image. The attention features are multiplied element-wise with the initial features to obtain the first-scale spatial context features. This allows the trained small object detection model to focus more on spatial regions that are beneficial to the object detection task, thereby improving the detection performance of the small object detection model.
[0088] For example, the sigmoid activation function σ(⋅) can be used to generate the spatial selection mask corresponding to the spatial attention map. Of course, other activation functions can also be used to generate the spatial selection mask corresponding to the spatial attention map, and the specific settings can be made according to actual needs. The spatial selection mask uses a value close to 0 or 1 to represent the importance of the spatial region corresponding to the spatial attention map in the remote sensing image, thereby realizing spatial selection of the decomposed large convolution kernel features.
[0089] Based on the above description, after obtaining the first scale spatial context features through the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, the first scale spatial context features can be input into the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, that is, the following S303 is executed.
[0090] S303. Based on the first-scale spatial context features and the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, the second-scale spatial context features are obtained.
[0091] For example, combined Figure 2 As shown in the embodiment of this application, a convolutional layer and a transformation layer are sequentially connected after the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module.
[0092] To obtain the second-scale spatial context features, based on the first-scale spatial context features and the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, the first-scale spatial context features can be first input into a convolutional layer, and the convolutional scale spatial context features can be output through the convolutional layer; the convolutional scale spatial context features can then be input into a transformation layer, and the transformation scale spatial context features can be output through the transformation layer; finally, the transformation scale spatial context features can be input into the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, and the second-scale spatial context features can be obtained through the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module.
[0093] It should be noted that the structure of the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module is similar to that of the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module in S302 above. Correspondingly, the implementation of obtaining the second-scale spatial context features through the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module is also similar to the implementation of obtaining the first-scale spatial context features through the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module. For details, please refer to the above description of obtaining the first-scale spatial context features through the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module. Here, the embodiments of this application will not be repeated.
[0094] S304. Based on the second-scale spatial context features and the third LSKNet-based large convolutional kernel hybrid domain attention mechanism module, the third-scale spatial context features are obtained.
[0095] For example, combined Figure 2 As shown in the embodiment of this application, the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module is subsequently connected to a convolutional layer and a transformation layer.
[0096] To obtain the third-scale spatial context features based on the second-scale spatial context features and the third LSKNet-based large convolutional kernel hybrid domain attention mechanism module, the second-scale spatial context features can be first input into the convolutional layer, and the convolutional scale spatial context features can be output through the convolutional layer; the convolutional scale spatial context features can then be input into the transformation layer, and the transformation scale spatial context features can be output through the transformation layer; finally, the transformation scale spatial context features can be input into the third LSKNet-based large convolutional kernel hybrid domain attention mechanism module, and the third-scale spatial context features can be obtained through the third LSKNet-based large convolutional kernel hybrid domain attention mechanism module.
[0097] It should be noted that the structure of the third LSKNet-based large convolutional kernel hybrid domain attention mechanism module is similar to that of the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module in S302 above. Correspondingly, the implementation of obtaining the third-scale spatial context features through the third LSKNet-based large convolutional kernel hybrid domain attention mechanism module is also similar to the implementation of obtaining the first-scale spatial context features through the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module. For details, please refer to the above description of obtaining the first-scale spatial context features through the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module. Here, the embodiments of this application will not be repeated.
[0098] Given that the remote sensing image is used as the input to the initial feature extraction module, and then passes through the first, second, and third LSKNet-based large convolutional kernel mixed domain attention mechanism modules in sequence, this process constitutes a downsampling process. Therefore, the first scale of the first-scale spatial context feature output by the first LSKNet-based large convolutional kernel mixed domain attention mechanism module is smaller than the second scale of the second-scale spatial context feature output by the second LSKNet-based large convolutional kernel mixed domain attention mechanism module, and the second scale of the second-scale spatial context feature output by the second LSKNet-based large convolutional kernel mixed domain attention mechanism module is smaller than the third scale of the third-scale spatial context feature output by the third LSKNet-based large convolutional kernel mixed domain attention mechanism module.
[0099] After obtaining the first-scale spatial context features, the second-scale spatial context features, and the third-scale spatial context features respectively, the following S305 can be executed.
[0100] S305. Input the first-scale spatial context features, the second-scale spatial context features, and the third-scale spatial context features into the feature fusion module, and obtain the corresponding first-scale splicing features, second-scale splicing features, and third-scale splicing features through the feature fusion module.
[0101] The feature fusion module effectively enhances the ability of the trained small target vehicle detection model to understand complex scenes in remote sensing images.
[0102] S306. Input the first-scale splicing feature into the first MLLA attention mechanism module to obtain the first-scale key feature. Input the second-scale splicing feature into the second MLLA attention mechanism module to obtain the second-scale key feature. Input the third-scale splicing feature into the third MLLA attention mechanism module to obtain the third-scale key feature.
[0103] S307. Based on the key features at the first scale, the key features at the second scale, the key features at the third scale, and the detection result labels, update the model parameters of the initial small target detection model to obtain the small target detection model.
[0104] For example, in the embodiments of this application, when updating the model parameters of the initial small target detection model based on the first-scale key features, the second-scale key features, the third-scale key features, and the detection result labels, the first detection result of the initial small target detection model for the remote sensing image can be determined based on the first-scale key features, the second-scale key features, and the third-scale key features; and the second detection result of the teacher model for the remote sensing image can be obtained; based on the first activation map of the teacher model's second detection result in a specific channel, the first KL divergence corresponding to the first activation map is determined, and based on the second activation map of the initial small target detection model's first detection result in a specific channel, the second KL divergence corresponding to the second activation map is determined; based on the difference between the first detection result and the detection result labels, the first KL divergence, and the second KL divergence, the model parameters of the initial small target detection model are updated. In this way, the channel-based knowledge distillation Cwd of dense prediction is used for dense prediction tasks. During the distillation process, by minimizing the Kullback-Leibler (KL) divergence between the channel probability maps of the teacher model and the student model, i.e. the initial small object detection model in this application, the class-specific knowledge of the teacher model at the channel level can be utilized more effectively to guide the student model to learn more accurately. While maintaining high performance, faster inference speed and lower resource consumption are achieved. This not only helps to improve the performance of the student model, but also deepens the understanding of the channel mechanism in deep learning models. Thus, while ensuring detection accuracy, computational complexity can be reduced and computational efficiency can be improved.
[0105] Knowledge distillation (KD) is a simple and effective tool for training compact and dense prediction models. It aims to improve the performance of student models by transferring knowledge from a complex and high-performance teacher model to a simpler and lighter student model.
[0106] For example, in an embodiment of this application, the first detection result of the initial small target detection model for the remote sensing image, determined based on the first-scale key features, the second-scale key features, and the third-scale key features, can be denoted as: The second detection result of the teacher model for the remote sensing image can be denoted as: Then, the calculation method for either the first KL divergence corresponding to the first activation map of the first detection result of the teacher model in a specific channel, and the second KL divergence corresponding to the second activation map of the first detection result in a specific channel, can be found in Formula 3 below.
[0107] Formula 3
[0108] in, This represents the KL divergence of the activation map corresponding to the detection result in a specific channel c, where c = 1, 2, ..., C, C represents the channel index, and i represents the index of the spatial position within the channel. Let represent the data for channel c, spatial location index i, W and H represent the width and height of the activation map, respectively, and T be a hyperparameter (called temperature) used to control the "softness" of the probability distribution. This method converts channel-level activation values into a probability distribution and uses KL divergence to evaluate the activation differences between the teacher and student models on a specific channel c.
[0109] Generally, the larger T is, the smoother the probability distribution becomes, which can consider a wider spatial region for each channel; the smaller T is, the sharper the probability distribution becomes, focusing on the region with higher activation values.
[0110] For example, the first KL divergence of the second detection result of the teacher model in the first activation map of a specific channel can be denoted as: The second KL divergence corresponding to the second activation map of a specific channel in the first detection result can be denoted as: .
[0111] It is understood that, in the embodiments of this application, the spatial knowledge distillation method can realize knowledge transfer between spatial locations through point-to-point alignment or alignment of structured information. Therefore, after determining the first KL divergence and the second KL divergence respectively, the method for updating the model parameters of the initial small target detection model based on the difference between the first detection result and the detection result label, the first KL divergence, and the second KL divergence can be found in the following formula 4.
[0112] Formula 4
[0113] in, The task loss is used to characterize the first detection result. The difference between the detected label y and the target label, for example, the task loss could be cross-entropy loss; This represents the hyperparameters used to balance the importance of different loss terms; This refers to the channel-level knowledge distillation paradigm, which guides student models to learn these category-specific knowledge from trained teacher models. This represents a feature extraction function used to extract the features that need to be distilled from the activation map. This represents the loss calculation function, used to evaluate the difference in probability distributions between the teacher model and the student model on a specific channel c. This represents the first activation map of the teacher model's second detection result in a specific channel c. This represents the second activation map of the first detection result of the initial small object detection model in a specific channel c.
[0114] Based on the above description, given that KL divergence can effectively measure the difference between two probability distributions, it is used as an evaluation metric to update the model parameters of the initial small object detection model. The smaller the KL divergence, the more similar the first activation map corresponding to the initial small object detection model and the second activation map corresponding to the teacher model are on a specific channel c. This indicates that the student model has learned more useful knowledge from the teacher model, thus enabling a better initialization of the model parameters for the small object detection model, and ultimately training the small object detection model.
[0115] As can be seen from the embodiments of this application, in order to effectively improve the detection efficiency and accuracy of small targets in remote sensing images, when training the small target detection model, three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules, a position-aware enhanced MLLA attention mechanism module (i.e., the first MLLA attention mechanism module, the second MLLA attention mechanism module, and the third MLLA attention mechanism module), and an efficient knowledge distillation strategy are used to effectively improve the detection efficiency and accuracy of the trained small target model for rotating small targets. This achieves accurate and efficient detection of small targets, not only improving detection performance but also enhancing the versatility and robustness of the small target model in practical applications.
[0116] The small target detection device provided in this application is described below. The small target detection device described below can be referred to in correspondence with the small target detection method described above.
[0117] Figure 5 This is a schematic diagram of a small target detection device provided in an embodiment of this application. For example, please refer to [link to relevant documentation]. Figure 5 As shown, the small target detection device 50 may include:
[0118] The acquisition unit 501 is used to acquire a target remote sensing image to be processed, wherein the target remote sensing image includes small targets to be detected;
[0119] The detection unit 502 is used to input the target remote sensing image into the small target detection model and obtain the detection result of the small target output by the small target detection model;
[0120] The small target detection model is obtained by introducing multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules in YOLOv8 to extract multi-scale spatial context features from remote sensing images in the training dataset, and training the initial small target detection model based on the multi-scale spatial context features and the detection result labels corresponding to the remote sensing images.
[0121] For example, in the embodiments of this application, the initial small target detection model includes an initial feature extraction module and three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules connected in series, a feature fusion module connected to the three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules, and a first MLLA attention mechanism module, a second MLLA attention mechanism module and a third MLLA attention mechanism module connected to the feature fusion module.
[0122] The small target detection model is trained in the following manner:
[0123] The remote sensing image is input into the initial feature extraction module, and the initial features of the remote sensing image are extracted by the initial feature extraction module;
[0124] The initial features are input into the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, and the first scale spatial context features are obtained through the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module.
[0125] Based on the first scale spatial context features and the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, the second scale spatial context features are obtained.
[0126] Based on the second-scale spatial context features and the third LSKNet-based large convolutional kernel hybrid domain attention mechanism module, the third-scale spatial context features are obtained.
[0127] The first scale spatial context features, the second scale spatial context features, and the third scale spatial context features are input into the feature fusion module, and the corresponding first scale splicing features, second scale splicing features, and third scale splicing features are obtained through the feature fusion module.
[0128] The first scale splicing feature is input into the first MLLA attention mechanism module to obtain the first scale key feature; the second scale splicing feature is input into the second MLLA attention mechanism module to obtain the second scale key feature; and the third scale splicing feature is input into the third MLLA attention mechanism module to obtain the third scale key feature.
[0129] Based on the first-scale key features, the second-scale key features, the third-scale key features, and the detection result labels, the model parameters of the initial small target detection model are updated to obtain the small target detection model.
[0130] For example, in the embodiments of this application, the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module is followed by a convolutional layer and a transformation layer in sequence;
[0131] The second-scale spatial context features, obtained based on the first-scale spatial context features and the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, include:
[0132] The first scale spatial context features are input into the convolutional layer, and the convolutional scale spatial context features are output through the convolutional layer.
[0133] The convolutional scale spatial context features are input into the transformation layer, and the transformation scale spatial context features are output through the transformation layer.
[0134] The transformed scale spatial context features are input into the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, and the second scale spatial context features are obtained through the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module.
[0135] For example, in an embodiment of this application, the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module includes multiple depthwise separable convolutional layers connected in series and a spatial selection layer connected to the multiple depthwise separable convolutional layers;
[0136] The step of inputting the initial features into the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, and obtaining the first scale spatial context features through the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, includes:
[0137] The initial features are sequentially input into multiple depthwise separable convolutional layers, and the corresponding depthwise separable features are output by the multiple depthwise separable convolutional layers respectively;
[0138] Multiple depthwise convolutional separable features are input into the spatial selection layer, and the spatial selection layer outputs the first-scale spatial context features.
[0139] For example, in an embodiment of this application, the step of inputting multiple depthwise convolutional separable features into the spatial selection layer and outputting the first-scale spatial context features through the spatial selection layer includes:
[0140] Multiple depthwise convolutional separable features are input into the spatial selection layer, and the spatial selection layer performs a concatenation process on the multiple depthwise convolutional separable features to obtain a depthwise convolutional separable concatenated feature.
[0141] The depthwise convolutional separable and spliced features are pooled using average pooling and max pooling based on the channels, respectively, to obtain the average pooling spatial feature description and the max pooling spatial feature description.
[0142] The concatenated features of the average pooling spatial feature description and the max pooling spatial feature description are transformed to obtain multiple spatial attention maps;
[0143] Based on the spatial selection mask corresponding to each of the spatial attention maps, the multiple spatial attention maps are weighted and fused to obtain attention features; wherein, the spatial selection mask corresponding to each spatial attention map is used to characterize the importance of the spatial region corresponding to the spatial attention map in the remote sensing image;
[0144] The attention features are multiplied element-wise with the initial features to obtain the first scale spatial context features.
[0145] For example, in this embodiment of the application, updating the model parameters of the initial small target detection model based on the first-scale key features, the second-scale key features, the third-scale key features, and the detection result label includes:
[0146] Based on the first-scale key features, the second-scale key features, and the third-scale key features, the first detection result of the initial small target detection model for the remote sensing image is determined.
[0147] Obtain the second detection result of the teacher model for the remote sensing image;
[0148] Based on the second detection result of the teacher model in the first activation map of a specific channel, determine the first KL divergence corresponding to the first activation map, and based on the first detection result of the initial small target detection model in the second activation map of the specific channel, determine the second KL divergence corresponding to the second activation map;
[0149] Based on the difference between the first detection result and the detection result label, the first KL divergence and the second KL divergence are used to update the model parameters of the initial small target detection model.
[0150] The small target detection device 50 provided in this application embodiment can execute the technical solution of the small target detection method in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the small target detection method. Please refer to the implementation principle and beneficial effects of the small target detection method. It will not be repeated here.
[0151] Figure 6 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this application, such as... Figure 6As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a small target detection method, which may include: acquiring a remote sensing image of a target to be processed, wherein the remote sensing image of the target includes a small target to be detected; inputting the remote sensing image of the target into a small target detection model, and obtaining the detection result of the small target output by the small target detection model; wherein the small target detection model is based on YOLOv8, which introduces multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules to extract multi-scale spatial context features from remote sensing images in the training dataset, and trains an initial small target detection model based on the multi-scale spatial context features and the detection result labels corresponding to the remote sensing images.
[0152] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0153] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the small target detection method provided by the above methods. The method may include: acquiring a remote sensing image of a target to be processed, wherein the remote sensing image of the target includes a small target to be detected; inputting the remote sensing image of the target into a small target detection model to obtain the detection result of the small target output by the small target detection model; wherein the small target detection model is based on YOLOv8, which introduces multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules to extract multi-scale spatial context features from remote sensing images in the training dataset, and trains an initial small target detection model based on the multi-scale spatial context features and the detection result labels corresponding to the remote sensing images.
[0154] In another aspect, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program is implemented to perform the small target detection methods provided by the above methods. The method may include: acquiring a remote sensing image of a target to be processed, wherein the remote sensing image of the target includes a small target to be detected; inputting the remote sensing image of the target into a small target detection model to obtain the detection result of the small target output by the small target detection model; wherein the small target detection model is based on YOLOv8, which introduces multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules to extract multi-scale spatial context features from remote sensing images in the training dataset, and trains an initial small target detection model based on the multi-scale spatial context features and the detection result labels corresponding to the remote sensing images.
[0155] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0156] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for detecting small targets, characterized in that, include: Acquire a remote sensing image of the target to be processed, wherein the remote sensing image of the target includes small targets to be detected; The target remote sensing image is input into the small target detection model to obtain the detection result of the small target output by the small target detection model; The small target detection model is obtained by introducing multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules into YOLOv8 to extract multi-scale spatial context features from remote sensing images in the training dataset, and training an initial small target detection model based on the multi-scale spatial context features and the detection result labels corresponding to the remote sensing images. The initial small target detection model includes an initial feature extraction module and three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules connected in series, a feature fusion module connected to the three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules, and a first MLLA attention mechanism module, a second MLLA attention mechanism module, and a third MLLA attention mechanism module connected to the feature fusion module. The small target detection model is trained as follows: the remote sensing image is input into the initial feature extraction module, which extracts initial features from the remote sensing image; the initial features are input into the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, which obtains the first scale spatial context features. The following steps are performed: First, spatial context features are generated. Second, spatial context features are generated based on the first scale spatial context features and the second, LSKNet-based large convolutional kernel hybrid domain attention mechanism module. Third, spatial context features are generated based on the second scale spatial context features and the third, LSKNet-based large convolutional kernel hybrid domain attention mechanism module. The first, second, and third scale spatial context features are input into the feature fusion module to obtain corresponding first, second, and third scale spliced features. The first scale spliced feature is input into the first MLLA attention mechanism module to obtain first-scale key features. The second scale spliced feature is input into the second MLLA attention mechanism module to obtain second-scale key features. The third scale spliced feature is input into the third MLLA attention mechanism module to obtain third-scale key features. Based on the first, second, and third scale key features and the detection result label, the model parameters of the initial small target detection model are updated to obtain the small target detection model.
2. The small target detection method according to claim 1, characterized in that, The first LSKNet-based large convolutional kernel hybrid domain attention mechanism module is followed by a convolutional layer and a transformation layer in sequence. The second-scale spatial context features, obtained based on the first-scale spatial context features and the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, include: The first scale spatial context features are input into the convolutional layer, and the convolutional scale spatial context features are output through the convolutional layer. The convolutional scale spatial context features are input into the transformation layer, and the transformation scale spatial context features are output through the transformation layer. The transformed scale spatial context features are input into the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module, and the second scale spatial context features are obtained through the second LSKNet-based large convolutional kernel hybrid domain attention mechanism module.
3. The small target detection method according to claim 1, characterized in that, The first LSKNet-based large convolutional kernel hybrid domain attention mechanism module includes multiple depthwise separable convolutional layers connected in series and a spatial selection layer connected to the multiple depthwise separable convolutional layers; The step of inputting the initial features into the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, and obtaining the first scale spatial context features through the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, includes: The initial features are sequentially input into multiple depthwise separable convolutional layers, and the corresponding depthwise separable features are output by the multiple depthwise separable convolutional layers respectively; Multiple depthwise convolutional separable features are input into the spatial selection layer, and the spatial selection layer outputs the first-scale spatial context features.
4. The small target detection method according to claim 3, characterized in that, The step of inputting multiple depthwise convolutional separable features into the spatial selection layer and outputting the first-scale spatial context features through the spatial selection layer includes: Multiple depthwise convolutional separable features are input into the spatial selection layer, and the spatial selection layer performs a concatenation process on the multiple depthwise convolutional separable features to obtain a depthwise convolutional separable concatenated feature. The depthwise convolutional separable and spliced features are pooled using average pooling and max pooling based on the channels, respectively, to obtain the average pooling spatial feature description and the max pooling spatial feature description. The concatenated features of the average pooling spatial feature description and the max pooling spatial feature description are transformed to obtain multiple spatial attention maps; Based on the spatial selection mask corresponding to each of the spatial attention maps, the multiple spatial attention maps are weighted and fused to obtain attention features; wherein, the spatial selection mask corresponding to each spatial attention map is used to characterize the importance of the spatial region corresponding to the spatial attention map in the remote sensing image; The attention features are multiplied element-wise with the initial features to obtain the first scale spatial context features.
5. The small target detection method according to any one of claims 1-4, characterized in that, The step of updating the model parameters of the initial small target detection model based on the first-scale key features, the second-scale key features, the third-scale key features, and the detection result labels includes: Based on the first-scale key features, the second-scale key features, and the third-scale key features, the first detection result of the initial small target detection model for the remote sensing image is determined. Obtain the second detection result of the teacher model for the remote sensing image; Based on the second detection result of the teacher model in the first activation map of a specific channel, determine the first KL divergence corresponding to the first activation map, and based on the first detection result of the initial small target detection model in the second activation map of the specific channel, determine the second KL divergence corresponding to the second activation map; Based on the difference between the first detection result and the detection result label, the first KL divergence and the second KL divergence are used to update the model parameters of the initial small target detection model.
6. A small target detection device, characterized in that, include: An acquisition unit is used to acquire a remote sensing image of a target to be processed, wherein the remote sensing image of the target includes small targets to be detected; The detection unit is used to input the remote sensing image of the target into the small target detection model and obtain the detection result of the small target output by the small target detection model; The small target detection model is obtained by introducing multiple LSKNet-based large convolutional kernel hybrid domain attention mechanism modules into YOLOv8 to extract multi-scale spatial context features from remote sensing images in the training dataset, and training an initial small target detection model based on the multi-scale spatial context features and the detection result labels corresponding to the remote sensing images. The initial small target detection model includes an initial feature extraction module and three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules connected in series, a feature fusion module connected to the three LSKNet-based large convolutional kernel hybrid domain attention mechanism modules, and a first MLLA attention mechanism module, a second MLLA attention mechanism module, and a third MLLA attention mechanism module connected to the feature fusion module. The small target detection model is trained as follows: the remote sensing image is input into the initial feature extraction module, which extracts initial features from the remote sensing image; the initial features are input into the first LSKNet-based large convolutional kernel hybrid domain attention mechanism module, which obtains the first scale spatial context features. The following steps are performed: First, spatial context features are generated. Second, spatial context features are generated based on the first scale spatial context features and the second, LSKNet-based large convolutional kernel hybrid domain attention mechanism module. Third, spatial context features are generated based on the second scale spatial context features and the third, LSKNet-based large convolutional kernel hybrid domain attention mechanism module. The first, second, and third scale spatial context features are input into the feature fusion module to obtain corresponding first, second, and third scale spliced features. The first scale spliced feature is input into the first MLLA attention mechanism module to obtain first-scale key features. The second scale spliced feature is input into the second MLLA attention mechanism module to obtain second-scale key features. The third scale spliced feature is input into the third MLLA attention mechanism module to obtain third-scale key features. Based on the first, second, and third scale key features and the detection result label, the model parameters of the initial small target detection model are updated to obtain the small target detection model.
7. An electronic 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, it implements the small target detection method as described in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the small target detection method as described in any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the small target detection method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Lightweight crack segmentation method and device, terminal equipment and storage medium
CN118097154A
Blind person travel auxiliary equipment based on deep learning
CN118942065A