Multi-scale target detection method and system based on dynamic sparse Mamba

By using a multi-scale target detection method based on dynamic sparse Mamba, the problems of insufficient multi-scale feature fusion and redundant feature interference are solved, achieving efficient multi-scale target detection and improving detection accuracy and computational efficiency.

CN122116012BActive Publication Date: 2026-07-07NORTHWESTERN POLYTECHNICAL UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTHWESTERN POLYTECHNICAL UNIV
Filing Date
2026-04-28
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing multi-scale object detection algorithms suffer from semantic gaps when fusing multi-scale features, making it difficult to effectively coordinate and model global contextual relationships. Furthermore, redundant features cause severe interference in complex backgrounds, resulting in limited detection accuracy and efficiency.

Method used

A multi-scale target detection method based on dynamic sparse Mamba is adopted. By dynamically fusing the neck network and the dynamic selective Mamba module, the deep semantic information is transferred to the shallow features and the shallow detail information is returned to the deep features. The global context is modeled by combining the state space model and the background redundancy is suppressed by sparsification.

Benefits of technology

It improves the accuracy and efficiency of multi-scale target detection, especially in scenarios with large differences in target scale, while reducing computational complexity and storage overhead, and maintaining detection accuracy and real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122116012B_ABST
    Figure CN122116012B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computer vision target detection, and particularly relates to a multi-scale target detection method and system based on dynamic sparse Mamba. The method comprises: obtaining a target image to be detected and performing preprocessing to obtain an image tensor; inputting the image tensor into a target detection neural network to output a class label and a bounding box coordinate of the target; the target detection neural network comprises a backbone network, a dynamic multi-path fusion neck network and a detection head connected in sequence; the neck network comprises a semantic transmission path and a detail transmission path, which are respectively composed of alternately connected convolution modules and Mamba enhanced CSP layers; each Mamba enhanced CSP layer comprises a dynamic selective Mamba module for context enhancement on the input features after alignment. The dynamic selective Mamba module realizes global context modeling and suppresses background redundancy through deformable convolution and dynamic sparse two-dimensional selective scanning, and a relatively optimal balance between detection accuracy, computational complexity and real-time performance is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision target detection technology, specifically to a multi-scale target detection method and system based on dynamic sparse Mamba. Background Technology

[0002] Multi-scale target detection has significant application value in image analysis, video surveillance, and image target recognition. In real-world detection scenarios, the targets to be detected in the acquired images (such as large vehicles, small work platforms, etc.) usually exhibit significant scale differences, and targets of different scales may coexist in the same image. This places high demands on the multi-scale feature representation capabilities of detection algorithms.

[0003] Single-stage object detection algorithms, represented by the YOLO series, are widely used in various object detection tasks due to their good balance between detection accuracy and inference efficiency. These methods typically employ feature pyramid networks or path aggregation networks to fuse multi-scale features. However, existing methods still have the following problems: On the one hand, simple upsampling, downsampling, and stitching operations are insufficient to fully bridge the semantic gap between shallow detail information (such as image edges and textures) and deep semantic information, leading to missed detections of small targets and affecting the localization accuracy of large targets; on the other hand, convolutional neural networks are limited by their inherent local receptive field characteristics, making them relatively limited in their ability to model the long-distance contextual relationships required for large targets.

[0004] To enhance the model's ability to model global information, some existing methods have introduced Transformer attention mechanisms or state-space models. For example, Chinese patent CN119313873A discloses a ship target detection method based on a large-kernel multi-scale attention mechanism, which expands the effective receptive field by decomposing large-size convolutional kernels and combining them with Ghost Modules. This method improves feature representation capabilities to some extent, but it is still essentially limited by the local inductive bias of convolutional operations, and lacks an effective mechanism for handling redundant feature interference in complex backgrounds (such as coastlines, waves, building edges, etc.).

[0005] Furthermore, while state-space models, exemplified by Mamba, demonstrate advantages in long-range modeling with linear complexity in natural language processing, their direct application to two-dimensional vision tasks presents significant limitations. Specifically, forcibly flattening two-dimensional image feature maps into one-dimensional sequences for scanning disrupts the local spatial semantic continuity of the original feature maps and introduces a large number of redundant background tokens irrelevant to the detection task. This increases unnecessary computational overhead and may also lead to a decrease in the detector's ability to discriminate small targets.

[0006] In summary, how to effectively integrate multi-scale features, establish global contextual dependencies, and suppress redundant background responses in complex scenarios while maintaining high inference efficiency is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0007] To address the shortcomings of existing technologies, this invention proposes a multi-scale target detection method and system based on dynamic sparse Mamba. This method solves the problems of insufficient multi-scale feature fusion, weak collaborative modeling ability between local details and global context, and severe interference from redundant features in complex backgrounds. As a result, it effectively improves the target detection accuracy while taking into account computational efficiency and deployment feasibility.

[0008] To achieve the above objectives, the present invention adopts the following technical solution:

[0009] This invention proposes a multi-scale target detection method based on dynamic sparse Mamba, comprising the following steps:

[0010] The target image to be detected is acquired, and the target image is preprocessed to obtain an image tensor;

[0011] The image tensor is input into a pre-trained target detection neural network, which performs multi-scale target detection on the target image and outputs the category labels and bounding box coordinates of all detected targets.

[0012] The target detection neural network includes a backbone network, a dynamic multi-path fusion neck network, and a detection head connected in sequence.

[0013] The backbone network is used to extract multi-scale features from the image tensor;

[0014] The dynamic multi-path fusion neck network is used to perform cross-scale fusion of multi-scale features and output enhanced multi-scale features. The dynamic multi-path fusion neck network includes a semantic delivery path and a detail delivery path. The semantic delivery path includes multiple first Mamba enhanced CSP layers connected sequentially from top to bottom to realize semantic delivery of multi-scale features from deep features to shallow features. The detail delivery path includes multiple second Mamba enhanced CSP layers connected sequentially from bottom to top to realize detail delivery of multi-scale features from shallow features to deep features.

[0015] Each of the first and second Mamba enhanced CSP layers includes a dynamically selective Mamba module, which is used to perform context enhancement on the input features that have completed channel alignment and spatial size alignment, and output intermediate enhanced features.

[0016] The detection head is used to generate the category label and bounding box coordinates based on the enhanced multi-scale features.

[0017] Furthermore, the dynamic multipath fusion neck network also includes a convolutional module, which is used to perform channel alignment on features at different scales and to perform spatial size alignment on feature maps at different scales through upsampling or downsampling.

[0018] Further, the first Mamba-enhanced CSP layer includes a first 1×1 convolutional layer and a main path; the first 1×1 convolutional layer is used to convolve the features input to the first Mamba-enhanced CSP layer and output intermediate features, which are split into main features and auxiliary features along the channel dimension; the main path includes a first 3×3 convolutional layer, a second 3×3 convolutional layer and the dynamic selective Mamba module connected in sequence, which are used to perform local convolution extraction and global context modeling on the main features, wherein the output of the second 3×3 convolutional layer is fused with the main feature residual and then input into the dynamic selective Mamba module to obtain intermediate enhanced features; the intermediate enhanced features are concatenated with the auxiliary features and then passed through the second 1×1 convolutional layer to obtain the enhanced features corresponding to the first Mamba-enhanced CSP layer.

[0019] Furthermore, the second Mamba enhanced CSP layer has the same internal structure as the first Mamba enhanced CSP layer.

[0020] Furthermore, the dynamically selective Mamba module includes deformable convolutional units, a first branch unit, a second branch unit, and a residual connection unit; the process by which the dynamically selective Mamba module performs context enhancement on the input features that have already undergone channel alignment and spatial size alignment includes:

[0021] The input features are subjected to layer normalization to obtain normalized features;

[0022] The deformable convolutional unit is used to adaptively sample the normalized features and output reconstructed features.

[0023] The first branch unit is used to sequentially perform linear mapping, 3×3 depthwise separable convolution and activation function processing on the reconstructed features to obtain activation features, and sequentially perform dynamic sparsification, two-dimensional selective scanning and layer normalization processing on the activation features to output the first branch features;

[0024] The second branch unit is used to sequentially perform linear mapping and activation function processing on the reconstructed features, and output gated features;

[0025] The first branch feature and the gated feature are multiplied element-wise and then linearly mapped to obtain the modulation feature. The modulation feature is then added to the normalized feature through the residual connection unit to obtain the intermediate enhancement feature.

[0026] Furthermore, the dynamic sparsity includes:

[0027] A binary mask is constructed for the activation features, retaining only the feature values ​​at the beginning of each scan line. By identifying feature points in a given location, sparse two-dimensional features can be obtained.

[0028] The two-dimensional selective scanning includes:

[0029] The sparsed two-dimensional features are expanded along four scanning directions to obtain four one-dimensional sequences;

[0030] Sequence modeling of each one-dimensional sequence is performed using a state-space mechanism, resulting in four enhanced one-dimensional sequences.

[0031] Sequence fusion was performed on four enhanced one-dimensional sequences to reconstruct two-dimensional spatial features.

[0032] Furthermore, for each scan line, The following conditions must be met:

[0033]

[0034] In the formula, This represents the total number of feature points on the scan line. For sparsity parameter, This is for rounding up.

[0035] Furthermore, the target detection neural network is an end-to-end detector based on the YOLO architecture.

[0036] This invention also proposes a multi-scale target detection system based on dynamic sparse Mamba to implement the above-mentioned multi-scale target detection method, comprising:

[0037] The image acquisition module is used to acquire the target image to be detected;

[0038] The preprocessing module is used to preprocess the target image to obtain an image tensor;

[0039] The detection processing module contains a pre-trained target detection neural network, which is used to perform multi-scale target detection on the target image and output the category label and bounding box coordinates of all detected targets.

[0040] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0041] (1) This invention constructs a dynamic multi-path fusion neck network that includes a semantic delivery path and a detail delivery path. The semantic delivery path uses multiple top-down alternating convolutional modules and Mamba-enhanced CSP layers, while the detail delivery path uses multiple bottom-up alternating convolutional modules and Mamba-enhanced CSP layers. Since the semantic delivery path progressively delivers deep semantic information to shallow features, it enhances the representation ability of small-scale targets. At the same time, the detail delivery path feeds back shallow edge and texture details to deep features, supplementing the localization information of large-scale targets, thereby achieving bidirectional collaborative fusion of deep semantics and shallow details. In addition, the Mamba-enhanced CSP layer adopts a structure of channel splitting, parallel processing of main and auxiliary paths, residual fusion, and splicing, which enhances the collaborative ability of local detail preservation and global context modeling of features. Therefore, this invention can effectively improve the detection accuracy of multi-scale targets, especially in scenarios with large differences in target scale.

[0042] (2) This invention introduces a dynamic selective Mamba module in the Mamba-enhanced CSP layer. This module first performs adaptive spatial sampling of the input features through deformable convolution. Since deformable convolution can learn spatial offsets and flexibly sample neighborhood positions, it maintains local semantic continuity as much as possible before flattening the two-dimensional features into a one-dimensional sequence. On this basis, a dynamic sparse two-dimensional selective scanning mechanism is further used for global sequence modeling. Since this mechanism only retains the most discriminative feature points and discards a large number of background features that are irrelevant to the detection task, it reduces the interference of invalid feature points on subsequent modeling from the source. Therefore, this invention not only retains the local spatial structure information of the two-dimensional feature map, but also leverages the advantage of the state-space model in capturing long-range dependencies under linear complexity, while effectively suppressing background redundancy responses in complex scenes, thus improving the detector's discriminative ability in complex backgrounds.

[0043] (3) The present invention uses a state-space model as the core operator for global context modeling, and the computational complexity of its sequence modeling is linearly related to the sequence length. At the same time, the dynamic sparsity strategy further reduces the number of feature points involved in the calculation, reduces the invalid computational overhead, and improves the detection accuracy while maintaining low computational complexity and storage overhead. It takes into account both model performance and deployment feasibility, and achieves a better balance between detection accuracy, computational complexity and real-time performance. Attached Figure Description

[0044] Figure 1 This is a schematic diagram of the overall structure of the target detection neural network in an embodiment of the present invention;

[0045] Figure 2 This is a schematic diagram of the internal structure of the first Mamba enhanced CSP layer in an embodiment of the present invention;

[0046] Figure 3 This is a schematic diagram of the internal structure of the dynamic selective Mamba module in an embodiment of the present invention. Detailed Implementation

[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] Example

[0049] This embodiment proposes a multi-scale target detection method based on dynamic sparse Mamba, including the following steps:

[0050] Step 1: Acquire an image of the target to be detected using an image acquisition device. This image acquisition device can be a fixed-position optical camera or a camera mounted on a mobile platform.

[0051] The acquired target image is preprocessed, including size normalization and standardization. In this embodiment, size normalization scales the input image to a uniform size of 640×640 pixels, and standardization is then performed to ensure that the distribution of the image data conforms to the input requirements of the target detection neural network, thereby obtaining the image tensor.

[0052] Step 2: Input the image tensor into the pre-trained target detection neural network, perform multi-scale target detection on the target image through the target detection neural network, and output the category labels and bounding box coordinates of all detected targets.

[0053] The object detection neural network is an end-to-end detector based on the YOLO architecture; in this embodiment, YOLOv8 is preferably used as the baseline. (Reference) Figure 1 The target detection neural network includes a backbone network, a dynamic multipath fusion neck network, and a detection head connected in sequence.

[0054] The backbone network is used to extract multi-scale features from the image tensor. In this embodiment, the backbone network extracts three sets of features of different sizes from the input image tensor, denoted as S3, S4, and S5, respectively. S3 is a shallow feature with high resolution and rich edge and texture details. S4 is a mid-level feature with resolution and semantic information between S3 and S5. S5 is a deep feature with low resolution and strong semantic information.

[0055] The dynamic multi-path fusion neck network includes a semantic delivery path and a detail delivery path. The semantic delivery path is used to progressively transfer deep semantic information to shallow features to enhance the representation ability of small-scale targets; the detail delivery path is used to progressively transfer shallow detail information to deep features to supplement the localization information of large-scale targets.

[0056] The semantic delivery path includes multiple convolutional modules connected alternately from top to bottom and a first Mamba enhanced CSP layer (first ME-CSPLayer). In the semantic delivery path, the input of each first ME-CSPLayer includes the features output by the backbone network corresponding to its spatial size and the output of the corresponding convolutional module. The input of the first convolutional module is the deepest feature output by the backbone network, which is used to perform channel alignment and spatial size alignment on the feature. Each subsequent convolutional module receives the enhanced features passed from the previous first ME-CSPLayer.

[0057] The detail delivery path includes multiple convolutional modules and a second Mamba-enhanced CSP layer (second ME-CSPLayer) connected alternately from bottom to top. In the detail delivery path, the input of the last second ME-CSPLayer includes the deepest features output from the backbone network and the output of the corresponding convolutional module; the input of the remaining second ME-CSPLayers includes the output of the first ME-CSPLayer corresponding to its spatial scale and the output of the corresponding convolutional module; the input of the first convolutional module is the output of the last first ME-CSPLayer, and each subsequent convolutional module receives the enhanced features delivered by the previous second ME-CSPLayer.

[0058] In this embodiment, three sets of features of different sizes are extracted from the input image tensor. Therefore, the semantic transfer path is composed of two convolutional modules and two first ME-CSPLayers connected alternately from top to bottom, and the detail transfer path is composed of two convolutional modules and two second ME-CSPLayers connected alternately from bottom to top.

[0059] In the semantic transmission path, the process of progressively transferring deep semantic information to shallow features is as follows:

[0060] The first convolutional module receives S5, performs channel alignment and spatial size alignment on S5, and obtains the alignment feature D5. The number of channels and spatial size of D5 are consistent with those of S4.

[0061] The alignment feature D5 is fused with S4, and the fused feature is input into the first ME-CSPLayer for context enhancement to obtain the enhanced feature Z45.

[0062] The second convolutional module receives the enhanced feature Z45, performs channel alignment and spatial size alignment on Z45, and obtains the aligned feature D45. The number of channels and spatial size of D45 are consistent with those of S3.

[0063] The alignment feature D45 is fused with S3, and the fused feature is input into the second first ME-CSPLayer for context enhancement to obtain the enhanced feature Z3.

[0064] In the detail propagation path, the process of progressively transferring shallow detail information to deeper features is as follows:

[0065] The first convolutional module receives Z3, performs channel alignment and spatial size alignment on Z3, and obtains the aligned feature D3. The number of channels and spatial size of D3 are consistent with those of S4.

[0066] The alignment feature D3 and the enhancement feature Z45 are fused together, and the fused feature is input into the first and second ME-CSPLayers for context enhancement to obtain the enhancement feature Z4.

[0067] The second convolutional module receives the enhanced feature Z4, performs channel alignment and spatial size alignment on Z4, and obtains the aligned feature D4; the number of channels and spatial size of D4 are consistent with those of S5.

[0068] The alignment features D4 and S5 are fused together, and the fused features are input into a second ME-CSPLayer for context enhancement to obtain the enhanced feature Z5.

[0069] The convolution module is used to perform channel alignment and spatial size alignment for features at different scales. Specifically, it first performs feature mapping on features at different scales (e.g., by adjusting the number of channels through a 1×1 convolutional layer) to achieve channel alignment. Then, it gradually expands the size of deep features to the size of shallow features through upsampling, or gradually shrinks the size of shallow features to the size of deep features through downsampling, thereby achieving spatial size alignment.

[0070] refer to Figure 2 Each first ME-CSPLayer includes a first 1×1 convolutional layer and a main path. Figure 2In this diagram, the symbol S represents splitting along the channel dimension, and the symbol C represents concatenation along the channel dimension. The first 1×1 convolutional layer convolves the input features and outputs intermediate features. These intermediate features are split along the channel dimension into main features and auxiliary features with the same number of channels. The main path includes a first 3×3 convolutional layer, a second 3×3 convolutional layer, and a Dynamic Selective Mamba (DSMamba) module connected sequentially. This module performs local convolution extraction and global context modeling on the main features. Specifically, the main features pass through the first 3×3 convolutional layer and the second 3×3 convolutional layer sequentially to extract local texture information. The output of the second 3×3 convolutional layer is fused with the main feature residual (i.e., element-wise addition) and then input into the Dynamic Selective Mamba module to establish long-range dependencies across regions, resulting in intermediate enhanced features. These intermediate enhanced features are then concatenated with the auxiliary features along the channel dimension and passed through the second 1×1 convolutional layer for feature fusion and information recombination, yielding the enhanced features corresponding to the first ME-CSPLayer.

[0071] The internal structure of the second ME-CSPLayer and its processing of input features are the same as those of the first ME-CSPLayer.

[0072] refer to Figure 3 The dynamic selective Mamba module includes a first-layer normalization module, deformable convolutional units, a first branch unit, a second branch unit, and a third linear mapping layer.

[0073] The first branch unit includes a first linear mapping layer, a 3×3 depth separable convolutional layer, a first activation function, a dynamic sparsification module, a multi-directional scanning module, and a second-layer normalization module, which are connected in sequence.

[0074] The second branch unit includes a second linear mapping layer and a second activation function.

[0075] The dynamic selective Mamba module processes input features that have already undergone channel alignment and spatial size alignment as follows:

[0076] The first-level normalization module performs layer normalization processing on the input features to obtain normalized features.

[0077] Deformable convolutional units perform adaptive spatial sampling on normalized features. Specifically, deformable convolutions learn spatial offsets and adaptively sample neighborhood positions, thereby preserving local semantic continuity as much as possible before flattening the two-dimensional features and outputting reconstructed features.

[0078] The first branch unit receives the reconstruction features and performs the following operations in sequence:

[0079] The first linear mapping layer performs a linear mapping on the reconstructed features to obtain the first mapped features;

[0080] A 3×3 depthwise separable convolutional layer is used to perform a 3×3 depthwise separable convolution on the first mapped features to obtain convolutional features;

[0081] The first activation function activates the convolutional features to obtain the activated features;

[0082] The dynamic sparsity module performs dynamic sparsity processing on the activation features to obtain sparse two-dimensional features. Dynamic sparsity processing is used to suppress redundant background features, retaining only the most discriminative feature points. The specific process of dynamic sparsity processing includes: processing the activation features... Construct a binary mask matrix Only retain the feature values ​​located at the front of each scan line. For each feature point, the mask value corresponding to the retained feature point is set to 1, and the mask value corresponding to the remaining feature points is set to 0, thus obtaining a sparse two-dimensional feature. Sparsified 2D features satisfy:

[0083]

[0084] In the formula, This indicates element-wise multiplication.

[0085] In this embodiment, for each scan line, The following conditions must be met:

[0086]

[0087] In the formula, This represents the total number of feature points on the scan line. For sparsity parameter, To round up. Preferably, the sparsity parameter... We set it to 0.5, meaning we only retain the top 50% of feature points with the highest feature values ​​on each scan line.

[0088] The two-dimensional selective scanning module performs two-dimensional selective scanning processing on sparse two-dimensional features to obtain scanned features; the two-dimensional selective scanning is used for global sequence modeling of sparse two-dimensional features. The specific process is as follows: First, the sparse two-dimensional features are unfolded along four scanning directions to obtain four one-dimensional sequences. The four scanning directions are from left to right, from right to left, from top to bottom, and from bottom to top, respectively. Then, a state-space mechanism is used to perform sequence modeling on each one-dimensional sequence. The state-space mechanism has linear computational complexity and can efficiently capture long-range dependencies in the sequence. After sequence modeling of each one-dimensional sequence, four enhanced one-dimensional sequences are obtained. Finally, the four enhanced one-dimensional sequences are fused to reconstruct the two-dimensional spatial features. Sequence fusion can be performed by adding corresponding positions or concatenating, etc. This embodiment preferably uses the method of adding corresponding positions for fusion.

[0089] The second-level normalization module performs layer normalization processing on the scanned features and outputs the first branch features.

[0090] The second branch unit receives the reconstruction features and performs the following operations in sequence:

[0091] The second linear mapping layer performs a linear mapping on the reconstructed features to obtain the second mapped features;

[0092] The second activation function activates the second mapped feature and outputs the gated feature.

[0093] In this embodiment, both the first activation function and the second activation function are SiLU functions.

[0094] The first branch feature is multiplied element by element with the gating feature to obtain the multiplication result, thereby achieving selective modulation of the first branch feature by the gating mechanism.

[0095] The third linear mapping layer performs a linear mapping on the multiplication result to obtain the modulation features.

[0096] The modulation features are added element-wise to the output of the first-layer normalization module to obtain the output features of the dynamic selective Mamba module, i.e., the intermediate enhancement features.

[0097] The detection head receives enhanced multi-scale features output from the dynamic multipath fusion neck network and generates target category labels and bounding box coordinates. In this embodiment, the detection head receives enhanced features Z3 output from the second first ME-CSPLayer, enhanced features Z4 output from the first second ME-CSPLayer, and enhanced features Z5 output from the second second ME-CSPLayer. The detection head uses a decoupled detection head based on the YOLO architecture to predict the target category and bounding box respectively.

[0098] The training and validation of the object detection neural network can be performed using public datasets such as ShipRSImageNet, HRSC2016, or Seaships7000. During training, the input image size is set to 640×640 pixels, the batch size is 4, the SGD optimizer is used, the initial learning rate is 0.01, the momentum is 0.937, and the weight decay is 0.0005.

[0099] To verify the effectiveness of the present invention, YOLOv8 is used as the baseline model, and two improved models are constructed based on YOLOv8: improved YOLOv8-1 and improved YOLOv8-2.

[0100] The difference between the improved YOLOv8-1 and YOLOv8 is that the C2f module in the neck network of YOLOv8 is replaced with the first ME-CSPLayer in the above embodiment (which has the same internal structure as the second ME-CSPLayer).

[0101] The difference between the improved YOLOv8-2 and the improved YOLOv8-1 is that the dynamic selective Mamba module in the improved YOLOv8-1 is replaced with the traditional Mamba module. The traditional Mamba module refers to the Mamba module that directly flattens and scans the two-dimensional image features and does not contain a dynamic sparsity mechanism.

[0102] YOLOv8, improved YOLOv8-1, and improved YOLOv8-2 were validated on the HRSC2016 and Seaships7000 datasets, respectively. Evaluation metrics included mean accuracy (mAP50:95) with an intersection-over-union (IoU) threshold of 0.5–0.95, gigaflops (GFLOPs), and parameter count. On the same dataset, the three models were validated under the same input size and training strategy. The validation results are shown in Table 1.

[0103] Table 1 Performance Comparison of Each Model

[0104]

[0105] As can be seen from Table 1, the method proposed in this invention can effectively improve the detection accuracy of multi-scale targets while maintaining low computational complexity and storage overhead, achieving a better balance between detection accuracy, computational complexity and real-time performance.

[0106] The specific embodiments of the present invention are provided to enable those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention.

[0107] It should be understood that the present invention is not limited to the content already described above, and various modifications and changes can be made without departing from its scope. The scope of the present invention is limited only by the appended claims.

Claims

1. A multi-scale target detection method based on dynamic sparse Mamba, characterized in that, Includes the following steps: The target image to be detected is acquired, and the target image is preprocessed to obtain an image tensor; The image tensor is input into a pre-trained target detection neural network, which performs multi-scale target detection on the target image and outputs the category labels and bounding box coordinates of all detected targets. The target detection neural network includes a backbone network, a dynamic multi-path fusion neck network, and a detection head connected in sequence. The backbone network is used to extract multi-scale features from the image tensor; The dynamic multi-path fusion neck network is used to perform cross-scale fusion of multi-scale features and output enhanced multi-scale features. The dynamic multi-path fusion neck network includes a semantic delivery path and a detail delivery path. The semantic delivery path includes multiple first Mamba enhanced CSP layers connected sequentially from top to bottom to realize semantic delivery of multi-scale features from deep features to shallow features. The detail delivery path includes multiple second Mamba enhanced CSP layers connected sequentially from bottom to top to realize detail delivery of multi-scale features from shallow features to deep features. Each of the first and second Mamba enhanced CSP layers includes a dynamically selective Mamba module, which is used to perform context enhancement on the input features that have completed channel alignment and spatial size alignment, and output intermediate enhanced features. The first Mamba enhanced CSP layer includes a first 1×1 convolutional layer and a main path; The first 1×1 convolutional layer is used to convolve the features input to the first Mamba enhanced CSP layer and output intermediate features. The intermediate features are split into main features and auxiliary features along the channel dimension. The main path includes a first 3×3 convolutional layer, a second 3×3 convolutional layer and the dynamic selective Mamba module connected in sequence. It is used to perform local convolution extraction and global context modeling on the main features. The output of the second 3×3 convolutional layer is fused with the main feature residual and then input into the dynamic selective Mamba module to obtain intermediate enhanced features. After the intermediate enhanced features and auxiliary features are concatenated, they are then passed through a second 1×1 convolutional layer to obtain the enhanced features corresponding to the first Mamba enhanced CSP layer. The second Mamba enhanced CSP layer has the same internal structure as the first Mamba enhanced CSP layer; The detection head is used to generate the category label and bounding box coordinates based on the enhanced multi-scale features.

2. The multi-scale target detection method based on dynamic sparse Mamba according to claim 1, characterized in that, The dynamic multipath fusion neck network also includes a convolutional module, which is used to perform channel alignment on features at different scales and to perform spatial size alignment on feature maps at different scales through upsampling or downsampling.

3. The multi-scale target detection method based on dynamic sparse Mamba according to claim 1, characterized in that, The dynamic selective Mamba module includes deformable convolutional units, first branch units, second branch units, and residual connection units; the process by which the dynamic selective Mamba module performs context enhancement on input features that have already undergone channel alignment and spatial size alignment includes: The input features are subjected to layer normalization to obtain normalized features; The deformable convolutional unit is used to adaptively sample the normalized features and output reconstructed features. The first branch unit is used to sequentially perform linear mapping, 3×3 depthwise separable convolution and activation function processing on the reconstructed features to obtain activation features, and sequentially perform dynamic sparsification, two-dimensional selective scanning and layer normalization processing on the activation features to output the first branch features; The second branch unit is used to sequentially perform linear mapping and activation function processing on the reconstructed features, and output gated features; The first branch feature and the gated feature are multiplied element-wise and then linearly mapped to obtain the modulation feature. The modulation feature is then added to the normalized feature through the residual connection unit to obtain the intermediate enhancement feature.

4. The multi-scale target detection method based on dynamic sparse Mamba according to claim 3, characterized in that, The dynamic sparsification includes: A binary mask is constructed for the activation features, retaining only the feature values ​​at the beginning of each scan line. By identifying feature points in a given location, sparse two-dimensional features can be obtained. The two-dimensional selective scanning includes: The sparsed two-dimensional features are expanded along four scanning directions to obtain four one-dimensional sequences; Sequence modeling of each one-dimensional sequence is performed using a state-space mechanism, resulting in four enhanced one-dimensional sequences. Sequence fusion was performed on four enhanced one-dimensional sequences to reconstruct two-dimensional spatial features.

5. The multi-scale target detection method based on dynamic sparse Mamba according to claim 4, characterized in that, For each scan line, The following conditions must be met: In the formula, This represents the total number of feature points on the scan line. For sparsity parameter, This is for rounding up.

6. The multi-scale target detection method based on dynamic sparse Mamba according to claim 1, characterized in that, The target detection neural network is an end-to-end detector based on the YOLO architecture.

7. A multi-scale target detection system based on dynamic sparse Mamba, used to implement the multi-scale target detection method according to any one of claims 1 to 6, characterized in that, include: The image acquisition module is used to acquire the target image to be detected; The preprocessing module is used to preprocess the target image to obtain an image tensor; The detection processing module contains a pre-trained target detection neural network, which is used to perform multi-scale target detection on the target image and output the category label and bounding box coordinates of all detected targets.