Sonar target detection method and device for complex marine environment

By combining the C3k2_SFD, MSDA, and C2DYT modules, the accuracy and adaptability issues of sonar target detection in complex marine environments were resolved, achieving higher detection accuracy and robustness.

CN120891503AActive Publication Date: 2025-11-04ZHEJIANG OCEAN UNIV

Patent Information

Application Number
CN202511427116.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2025-11-04
Estimated Expiration
2045-09-30

AI Technical Summary

Technical Problem

Existing sonar target detection methods face problems such as sparse texture, blurred edges, drastic changes in target shape, large scale span, and strong echo interference in complex marine environments, resulting in insufficient detection accuracy and adaptability.

Method used

The C3k2_SFD module constructs global and local attention branches through frequency weight decomposition and spatial modulation, the MSDA module modulates features through multi-scale dynamic attention, and the C2DYT module improves feature extraction and target detection capabilities through dynamic activation layer compression and affine adjustment.

Benefits of technology

It improves the accuracy and robustness of sonar target detection, enhances adaptability to complex marine environments, and enables more accurate capture of target features while suppressing noise interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120891503A_ABST
    Figure CN120891503A_ABST
Patent Text Reader

Abstract

The invention provides a sonar target detection method and device for a complex marine environment. According to the method provided by the invention, a C3k2SFD module maps a convolution kernel weight to a frequency domain through frequency weight decomposition, sets are divided according to a frequency mode length and then recombined into a convolution weight, a global attention branch and a first local branch are constructed in combination with spatial modulation to generate a dynamic convolution weight, and sub-band features are adjusted through frequency band modulation and a spatial attention graph; the MSDA module performs normalization and channel expansion on the input features, then splits the features, extracts spatial attention features through deep convolution of different directions and sizes, fuses various receptive field features, and multiplies the features with another feature; the C2DYT module carries out feature nonlinear compression control on extreme value echo features through the first dynamic activation layer, carries out dynamic range compression and channel-level affine adjustment on the second dynamic activation layer, combines residual connection, and effectively improves the accuracy and robustness of target detection in a complex marine environment through the combined action of the three.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of sonar target detection technology, and in particular to a sonar target detection method and apparatus for complex marine environments. Background Technology

[0002] Sonar target detection is a key technology for improving the intelligence level of underwater detection. Because the sonar system it relies on has a long propagation distance in water and strong anti-interference ability, it can still work stably even in complex underwater environments such as turbid water or no light. It plays an irreplaceable role in underwater rescue, environmental perception, marine resource exploration and other fields. It can provide important support for the location, identification and parameter extraction of underwater targets. Therefore, carrying out research on sonar target detection has important theoretical and practical significance.

[0003] Currently, sonar target detection methods have evolved from traditional techniques to deep learning. Early methods relied on manually designed feature engineering, such as traditional image processing algorithms like SIFT and HOG, combined with machine learning methods like support vector machines and Bayesian classifiers. With the development of deep learning, various new methods have emerged, including two-stage detection strategies based on Faster R-CNN, end-to-end one-stage detection based on YOLO series models, detection models based on the Vision Transformer architecture, and detectors based on the RT-DETR framework. Among these, the YOLO series models have become a research hotspot in sonar scenarios due to their real-time advantages, and have been improved through various methods such as feature sparsity and multi-scale attention mechanisms. However, current detection methods still face many challenges: sonar images suffer from sparse texture and blurred edges, limiting the extraction of key features by convolutional neural networks; target morphology varies drastically and scales widely, requiring higher multi-scale modeling capabilities from the model; strong echoes cause attention bias that interferes with the model learning process; and sonar systems are often deployed on resource-constrained platforms, requiring a balance between detection accuracy and lightweight design.

[0004] Therefore, there is an urgent need for a method to improve the accuracy and adaptability of sonar target detection in complex marine environments. Summary of the Invention

[0005] In view of this, this application provides a sonar target detection method and apparatus for complex marine environments, in order to improve the accuracy and adaptability of sonar target detection in complex marine environments.

[0006] Specifically, this application is implemented through the following technical solution:

[0007] The first aspect of this application provides a sonar target detection method for complex marine environments, the method comprising:

[0008] Construct a sonar image dataset;

[0009] The detection model is trained using a sonar image dataset to obtain a trained detection model;

[0010] The detection model includes the C3k2_SFD module, the MSDA module, and the C2DYT module. The C3k2_SFD module maps the convolutional kernel weights to the frequency domain through frequency weight decomposition, divides the frequency set according to the frequency modulus, maps each frequency set back to the spatial domain, and reassembles them into convolutional weights. Based on the convolutional weights, a global attention branch and a first local branch are constructed through spatial modulation and fused to generate modulated dynamic convolutional weights. Based on the dynamic convolutional weights, a spectral representation is obtained through frequency band modulation, and the spectral sub-bands are divided using a preset frequency band mask. The frequency band response at different positions is adjusted through the spatial attention map generated by the input feature map, and all sub-band features are fused.

[0011] The MSDA module normalizes and expands the input features to obtain the first feature and the second feature. It extracts the spatial attention features of the first feature through depth convolution with different directions and sizes, performs attention modulation and fusion on the convolution features of multiple receptive fields, and multiplies the fused features element-wise with the second feature.

[0012] The C2DYT module performs non-linear compression of features at the input end of the attention path through the first dynamic activation layer, and performs dynamic range compression and channel-level affine adjustment of features before the feedforward convolution through the second dynamic activation layer.

[0013] The sonar image to be detected is input into the trained detection model, and the target detection result is output.

[0014] The second aspect of this application provides a sonar target detection device for complex marine environments, the device comprising a construction module, a training module, and an output module;

[0015] The construction module is used to construct a sonar image dataset;

[0016] The training module is used to train the detection model using a sonar image dataset to obtain a trained detection model.

[0017] The detection model includes the C3k2_SFD module, the MSDA module, and the C2DYT module. The C3k2_SFD module maps the convolutional kernel weights to the frequency domain through frequency weight decomposition, divides the frequency set according to the frequency modulus, maps each frequency set back to the spatial domain, and reassembles them into convolutional weights. Based on the convolutional weights, global attention branches and local branches are constructed through spatial modulation and fused to generate modulated dynamic convolutional weights. Based on the dynamic convolutional weights, a spectral representation is obtained through frequency band modulation. The spectral sub-bands are divided using a preset frequency band mask. The frequency band response at different positions is adjusted through the spatial attention map generated by the input feature map, and all sub-band features are fused.

[0018] The MSDA module normalizes and expands the input features to obtain the first feature and the second feature. It extracts the spatial attention features of the first feature through depth convolution with different directions and sizes, performs attention modulation and fusion on the convolution features of multiple receptive fields, and multiplies the fused features element-wise with the second feature.

[0019] The C2DYT module performs non-linear compression of features at the input end of the attention path through the first dynamic activation layer, and performs dynamic range compression and channel-level affine adjustment of features before the feedforward convolution through the second dynamic activation layer.

[0020] The output module is used to input the sonar image to be detected into the trained detection model and output the target detection result.

[0021] The sonar target detection method and apparatus provided in this application for complex marine environments utilize the C3k2_SFD module. This module maps convolutional kernel weights to the frequency domain through frequency weight decomposition, divides the data into sets according to frequency modulus, and reassembles them into convolutional weights. It then combines spatial modulation to construct a global attention branch and a first local branch to generate dynamic convolutional weights. Further adjustments to sub-band features via frequency band modulation and spatial attention maps enable more accurate capture of features from different frequency components in sonar images, enhancing the ability to distinguish between target and background frequency differences in complex marine environments and improving the targeting of feature extraction. MSDA The module normalizes and expands the input features before splitting them. It extracts spatial attention features through depthwise convolutions of different directions and sizes and fuses multiple receptive field features. Then, it multiplies these features with another feature, which can effectively capture target features of different scales and directions. This enhances the adaptability of the detection model to changes in target morphology in sonar images and improves the detection capability for targets of different sizes and postures. The C2DYT module uses a first dynamic activation layer to nonlinearly compress and control extreme echo features, and a second dynamic activation layer to perform dynamic range compression and channel-level affine adjustment. Finally, combined with residual connections, it can suppress extreme noise interference, optimize feature distribution, and balance channel importance. This reduces the impact of strong echoes and other noise on detection in complex marine environments. The three working together make the detection model more accurate and stable in detecting sonar targets in complex marine environments, effectively improving the accuracy and robustness of target detection. Attached Figure Description

[0022] Figure 1 A flowchart of a sonar target detection method for complex marine environments provided in Embodiment 1 of this application;

[0023] Figure 2 This is a schematic diagram of the structure of the detection model provided in this application;

[0024] Figure 3 This is a schematic diagram of the structure of the C3k2_SFD module provided in this application;

[0025] Figure 4 This is a schematic diagram of the MSDA module provided in this application;

[0026] Figure 5 This is a schematic diagram of the structure of the C2DYT module provided in this application;

[0027] Figure 6 This is a schematic diagram of the structure of the sonar target detection device for complex marine environments provided in Embodiment 2 of this application. Detailed Implementation

[0028] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.

[0029] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used herein are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0030] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0031] The following specific embodiments are given to illustrate the technical solution of this application in detail.

[0032] Figure 1 This is a flowchart of a sonar target detection method for complex marine environments provided in Embodiment 1 of this application. Please refer to... Figure 1 The method provided in this embodiment may include:

[0033] S101. Construct a sonar image dataset.

[0034] Specifically, sonar images are two-dimensional grayscale images generated by digital signal processing and image reconstruction algorithms after a sonar system receives echo signals from underwater targets and their environment. Sonar images reflect the echo intensity distribution of underwater targets and their environment, containing rich information such as the spatial structure and contours of the targets, and are the direct processing object for sonar target detection. A sonar image dataset is a collection of a large number of sonar images constructed for training and evaluating detection models. It typically covers various complex scenes and interference factors in real marine environments, including multiple types of underwater targets such as spheres, cubes, and underwater robots. These images undergo preprocessing (such as image resolution adjustment and target annotation) and are divided into training, validation, and test sets to support the training, validation, and performance evaluation of detection models.

[0035] In specific implementation, the construction of the sonar image dataset includes: collecting sonar images in real marine environments; the sonar images cover various scenes, interference factors, and underwater targets; preprocessing the collected sonar images; and dividing the preprocessed sonar images into training set, validation set, and test set according to a preset ratio to obtain the sonar image dataset.

[0036] Specifically, echo data is collected in actual marine scenarios using sonar equipment. After processing, it is converted into sonar images. The collected sonar images cover different marine scenarios (such as shallow sea, deep sea, nearshore, and offshore), contain various interference factors (such as water flow interference, noise interference, and seabed clutter), and various typical underwater targets (such as spheres, cubes, underwater robots, tires, and metal barrels). Further, the resolution of the collected sonar images is adjusted, and the image size is standardized to accommodate subsequent model training. Simultaneously, professional annotation tools are used to label the targets in the sonar images, clarifying their location, category, and other information. The preprocessed sonar images are divided into training, validation, and test sets according to a preset ratio: for example, a 7:2:1 or 8:1:1 ratio. The training set is used for parameter learning of the detection model, the validation set is used for performance evaluation and hyperparameter adjustment during training, and the test set is used for final evaluation of the detection model's generalization ability. After the division, the sonar image dataset is obtained.

[0037] S102. Train the detection model using the sonar image dataset to obtain the trained detection model.

[0038] The detection model includes the C3k2_SFD module, the MSDA module, and the C2DYT module. The C3k2_SFD module maps the convolutional kernel weights to the frequency domain through frequency weight decomposition, divides the frequency set according to the frequency modulus, maps each frequency set back to the spatial domain, and reassembles them into convolutional weights. Based on the convolutional weights, a global attention branch and a first local branch are constructed through spatial modulation and fused to generate modulated dynamic convolutional weights. Based on the dynamic convolutional weights, a spectral representation is obtained through frequency band modulation, and the spectral sub-bands are divided using a preset frequency band mask. The frequency band response at different positions is adjusted through the spatial attention map generated by the input feature map, and all sub-band features are fused.

[0039] The MSDA module normalizes and expands the input features to obtain the first feature and the second feature. It extracts the spatial attention features of the first feature through depth convolution with different directions and sizes, performs attention modulation and fusion on the convolution features of multiple receptive fields, and multiplies the fused features element-wise with the second feature.

[0040] The C2DYT module performs non-linear compression of features at the input end of the attention path through the first dynamic activation layer, and performs dynamic range compression and channel-level affine adjustment of features through the second dynamic activation layer before the feedforward convolution.

[0041] Specifically, Figure 2 This is a schematic diagram of the detection model provided in this application. Please refer to... Figure 2 The detection model includes the C3k2_SFD module, the MSDA module, and the C2DYT module. The C3k2_SFD module is typically used in the feature extraction stage of the detection model and is a key component of the backbone network. Based on the improved C3 module, the C3k2_SFD module combines a k=2 convolutional kernel design and a spatial difference mechanism to enhance the extraction capability of low-contrast regions and detailed features in sonar images, providing richer basic features for subsequent feature processing. The MSDA module (also called the multi-scale spatial decomposition attention module) is mostly used in the feature fusion stage and is often integrated into feature pyramid networks or similar multi-scale feature processing structures. As a multi-scale dynamic attention module, the MSDA module strengthens the feature representation of multi-scale targets (especially small targets and targets with drastic scale changes) by dynamically adjusting the attention weights of features at different scales, while suppressing attention bias caused by background interference and strong echoes. The C2DYT module is generally used in the feature refinement stage of the detection head to further process the fused features. The C2DYT module is based on a lightweight design and combines dynamic context awareness and an efficient channel attention mechanism. While reducing the complexity of model parameters, it improves the ability to capture deep semantic features of the target, balances the requirements of detection accuracy and model lightweighting, and is compatible with resource-constrained sonar deployment platforms.

[0042] The following sections will introduce each module of the detection module in turn.

[0043] Figure 3 This is a schematic diagram of the C3k2_SFD module provided in this application. Please refer to... Figure 3 The C3k2_SFD module includes a partial frequency dynamic convolution unit, a first pointwise convolution unit, and a second pointwise convolution unit connected in sequence.

[0044] After receiving the input feature map, the frequency dynamic convolution unit performs frequency dynamic modeling on the target channel, maps the convolution kernel weights to the frequency domain and divides the frequency set, reorganizes them into convolution weights through inverse discrete Fourier transform, establishes the first global feature and the first local feature by combining spatial modulation, and outputs the preliminary processed features through frequency band modulation.

[0045] The first pointwise convolutional unit receives the preliminary processed features output by the partial frequency dynamic convolutional unit, expands the feature channels using a dual-channel expansion strategy, and enhances the nonlinear expressive power of the features by combining batch normalization and activation functions.

[0046] The second pointwise convolutional unit receives the expanded features output by the first pointwise convolutional unit, compresses the number of channels back to the original size, adds it to the initial input feature map of the C3k2_SFD module through residual connections, and outputs the final processed features.

[0047] Specifically, after receiving the input feature map, the partial frequency dynamic convolutional unit initiates a frequency dynamic modeling process for the preset target channel (while keeping the other channels in their original state). First, the convolutional kernel weights are mapped to the frequency domain, dividing the space into several frequency sets according to frequency characteristics. An inverse discrete Fourier transform is performed on each frequency set, mapping it back from the frequency domain to the spatial domain, and recombining it into convolutional weights with specific frequency responses. Based on the recombined convolutional weights, a spatial modulation mechanism is used to extract the first global feature (establishing global dependencies across channels and spaces) and the first local feature (capturing high-frequency details in local regions). The global and local features are then subjected to frequency band modulation processing, and the integrated features are output as preliminary processed features. The first pointwise convolutional unit receives the preliminary processed features output by the partial frequency dynamic convolutional unit. A dual-channel expansion strategy is used to expand the number of feature channels (e.g., doubling the number of channels). During channel expansion, batch normalization is simultaneously combined to stabilize the feature distribution, and a nonlinear transformation is introduced through an activation function (e.g., SiLU) to enhance the nonlinear expressive power of the features. The second pointwise convolutional unit receives the expanded features output by the first pointwise convolutional unit; it then compresses the expanded channel number back to the initial input features of the module through convolution operations. Figure 1 To achieve the desired scale, a residual connection method is used to add the compressed features element-wise to the initial input feature map received by the C3k2_SFD module; the output of the added features is used as the final processed features of the module.

[0048] For example, the input-output relationship of the C3k2_SFD module can be represented as:

[0049] ;

[0050] Among them, the The features of the output; The features are the input.

[0051] The method provided in this embodiment uses the C3k2_SFD module to perform frequency dynamic modeling of the target channel through partial frequency dynamic convolution units. First, the convolution kernel weights are mapped to the frequency domain and the frequency set is divided. These are then recombined into convolution weights via inverse discrete Fourier transform. Next, spatial modulation is combined to establish the first global feature and the first local feature. Finally, the preliminary processed features are output through frequency band modulation. This process can accurately capture the feature information of different frequency components, addressing common problems in sonar images such as sparse texture and blurred edges. It grasps the overall structure of the target through global features and captures detailed contours using local features, enhancing the feature discrimination capability for low-contrast regions and complex-shaped targets. After receiving the preliminary processed features, the first pointwise convolution unit utilizes... The dual-channel expansion strategy expands the feature channels, and combined with batch normalization and activation functions, it not only increases the dimensionality and richness of the features, but also enhances the expressive power of the features through nonlinear transformation. This allows the module to better learn the complex differences between targets and backgrounds in sonar images and adapt to feature changes in different scenarios. The second pointwise convolutional unit compresses the expanded number of channels back to the original size and adds it to the initial input feature map of the C3k2_SFD module through residual connections. While ensuring feature processing efficiency and controlling model complexity, it effectively preserves the original feature information, avoids feature loss during processing, and ensures the stability of gradient propagation, enabling the model to learn useful features more efficiently during training. In summary, the C3k2_SFD module, through the synergistic effect of its units, comprehensively improves the feature extraction and representation capabilities of various targets in sonar images (including targets that are disturbed, have large scale variations, and are low-resolution), thus providing a more accurate and richer feature foundation for subsequent detection processes. Ultimately, this improves the accuracy, robustness, and adaptability of sonar target detection to complex marine environments.

[0052] Optionally, the partial frequency dynamic convolution unit includes a frequency weight decomposition subunit, a spatial modulation subunit, and a frequency band modulation subunit connected in sequence.

[0053] (1) The frequency weight decomposition subunit maps the convolution kernel weights to the frequency domain to obtain a learnable spectrum matrix, sorts the frequency index sets according to the frequency modulus, applies the inverse discrete Fourier transform to each set to map back to the spatial domain and reassembles them into convolution weights.

[0054] Specifically, the Fourier Disjoint Weight (FDW) subunit is a key subunit in the frequency dynamic convolution unit. Its main function is to decompose and recombine the convolution kernel weights in the frequency domain to achieve refined processing of the convolution weights, providing a more targeted weight basis for subsequent spatial modulation and frequency band modulation, thereby enhancing the detection model's ability to capture different frequency features. It is especially suitable for processing complex frequency component distributions in sonar images.

[0055] Optionally, the step of applying inverse discrete Fourier transform to each set to map back to the spatial domain and reorganize it into convolutional weights includes: applying a two-dimensional inverse discrete Fourier transform to each set of frequency indices to map the spectral coefficients in the frequency domain back to the spatial domain to obtain corresponding spatial domain parameters; reorganizing the spatial domain parameters to form first convolutional weights; performing global average pooling on the input feature map and generating a set of dynamic attention coefficients through a fully connected layer and an activation function; and performing a weighted operation between the dynamic attention coefficients and the first convolutional weights to obtain the final convolutional weights used for feature extraction.

[0056] In specific implementation, for each frequency index set divided by frequency magnitude in the frequency weight decomposition subunit, a two-dimensional inverse discrete Fourier transform is applied to convert the spectral coefficients of each set in the frequency domain into parameters in the spatial domain, obtaining the spatial domain parameters corresponding to each set. The spatial domain parameters obtained by the inverse discrete Fourier transform of all sets are integrated and recombined to form the first convolution weight with basic feature extraction capabilities. A global average pooling operation is performed on the input feature map to compress the spatial dimension to extract global feature information. The pooling result is input into a fully connected layer for feature transformation, and then a set of dynamic attention coefficients that reflect the importance of features are generated through an activation function (such as sigmoid). The generated dynamic attention coefficients are weighted with the first convolution weights at corresponding positions, so that the convolution weights are adaptively adjusted according to the dynamic changes of the input features, and finally convolution weights that can be used for feature extraction are obtained.

[0057] For example, in one embodiment, the frequency weight decomposition subunit learns the parameters in groups in the Fourier domain to generate multiple convolutional kernels with different frequency responses. Specifically, the frequency weight decomposition subunit first processes the standard convolutional kernel... The weights are mapped to the frequency domain to obtain a learnable spectrum matrix composed of complex spectral coefficients. The spectral coefficients are then sorted according to their frequency modulus and divided into n non-overlapping sets of frequency indices. Where i = 1, 2, ..., n. Each set corresponds to a frequency band region, thus generating a set of convolutional kernels with different frequency feature distributions. Each frequency subset retains learning ability only within its corresponding frequency band, setting other frequency points to zero. Then, a two-dimensional inverse discrete Fourier transform (IDFT) is applied to each frequency subset to map it back to the spatial domain to obtain... Further reorganization into standard-shaped convolution weights The iDFT expression can be represented as:

[0058] ;

[0059] Where k is the kernel size, C mThis refers to the number of channels set in the partial convolution. It is a parameter with a two-dimensional frequency index of (x, y). is the parameter at position (t, h) in the spatial domain; n is the number of frequency index sets.

[0060] In generating standard convolution weights During the process, the input feature map X is processed through global average pooling, a fully connected (FC) layer, and a sigmoid activation function to obtain a set of dynamically generated attention coefficients {α1, …, α}. n This set of attention coefficients and The weighted operation can be expressed as:

[0061] ;

[0062] Among them, the The first convolution weight; The dynamic attention coefficient; These are the convolution weights.

[0063] The method provided in this embodiment involves a frequency weight decomposition subunit that maps convolutional kernel weights to the frequency domain to obtain a learnable spectrum matrix. It then divides the frequency index set according to frequency magnitude, applies a two-dimensional inverse discrete Fourier transform to each set to map it back to the spatial domain, obtains spatial domain parameters, and reassembles them into the first convolutional weights. Simultaneously, after global average pooling of the input feature map, dynamic attention coefficients are generated through a fully connected layer and activation function. These coefficients are then weighted with the first convolutional weights to obtain the final convolutional weights. This series of methods enables refined decomposition of the frequency components of the convolutional kernel at the frequency domain level, allowing the detection model to target specific frequency components. This method captures features of different frequencies in sonar images (such as high-frequency information of target contours and low-frequency information of the background), and achieves accurate conversion from the frequency domain to the spatial domain through inverse discrete Fourier transform, preserving the spatial distribution characteristics of key frequency features. The introduction of dynamic attention coefficients allows the convolution weights to be dynamically adjusted according to the input features, enhancing the adaptability to complex interference in sonar images (such as strong echoes and noise), reducing invalid feature interference, and ultimately enabling the detection model to extract target features more accurately in sonar target detection, improving the ability to identify blurry and low-contrast targets, and improving detection accuracy and robustness.

[0064] (2) The spatial modulation subunit establishes the first global features across channels and across space through the global attention branch based on the convolution weights, captures the first local features through the first local branch, and fuses them to generate the modulated dynamic convolution weights.

[0065] Specifically, the Kernel Spatial Modulation (KSM) is a key subunit in the partial frequency dynamic convolution unit. Its main function is to dynamically modulate the convolution weights by fusing global dependencies and local detail features, so that the convolution weights can take into account both global context information and local feature details. This enhances the detection model's ability to capture the overall structure and local details of targets in sonar images, and improves the comprehensiveness and accuracy of feature extraction.

[0066] Optionally, the spatial modulation subunit, based on the aforementioned convolutional weights, establishes a first global feature across channels and space through a global attention branch, captures a first local feature through a first local branch, and fuses to generate modulated dynamic convolutional weights, including: performing global average pooling on the input feature map to generate an embedding tensor; based on the embedding tensor, generating a first attention weight based on the input channel, a second attention weight based on the output channel, and a third attention weight oriented towards spatial location through three independent two-dimensional convolutions and activation functions, respectively, and uniformly converting the attention weights into a form consistent with the dimension of the dynamic convolutional kernel weight tensor; using a one-dimensional convolution and activation function to perform cross-channel modeling of the channel features of the input feature map to generate local attention weights; and multiplying the first attention weight, the second attention weight, the third attention weight, and the local attention weights element-wise with the convolutional weights to obtain the modulated dynamic convolutional weights.

[0067] In practice, a global average pooling operation is performed on the input feature map to compress the spatial dimension and extract global statistical information, generating an embedding tensor containing global feature information. Based on the embedding tensor, it is processed by three independently configured two-dimensional convolutional layers and activation functions: the first combination generates a first attention weight to emphasize the features of the input channel, the second combination generates a second attention weight to emphasize the features of the output channel, and the third combination generates a third attention weight to highlight key spatial locations. These three attention weights are uniformly converted into the same dimensional form as the dynamic convolutional kernel weight tensor to ensure compatibility of subsequent operations. Furthermore, a one-dimensional convolutional layer and activation function are used to perform cross-channel modeling of the channel features of the input feature map, capturing the correlation between channels and generating local attention weights to focus on local regional details. The four types of weights—first attention weight, second attention weight, third attention weight, and local attention weight—are multiplied element-wise with the convolutional weights, and the final modulated dynamic convolutional weights are obtained through the collaborative modulation of multi-dimensional attention.

[0068] For example, in one embodiment, the spatial modulation subunit introduces a learnable dense modulation matrix to modulate the spatial location of each k×k filter point-by-point, enabling independent adjustment of the convolution weights in the spatial domain. Specifically, the spatial modulation subunit includes a global attention branch and a local high-resolution branch. The former is used to establish global structural dependencies across channels and across space, while the latter focuses on capturing high-frequency detail features in local regions. The two branches are fused at the output stage to generate the final modulation matrix used to modulate the dynamic convolution weights. In a specific implementation, the input feature map X generates a global feature embedding tensor through global average pooling, which can be represented as:

[0069] ;

[0070] Among them, the For embedding tensors; the This is the input feature map.

[0071] The dimension of the embedding tensor is This tensor contains a compressed representation of the input image at the global semantic level. Based on this tensor, the global attention branch is designed as an adaptive weight generator oriented towards input features, aiming to capture attention from three key dimensions: input channel, output channel, and spatial location, within the global context. This branch extracts the global semantic features of Xembend through an FC layer and a sigmoid function, and then generates attention in different dimensional spaces using three independent 2D convolutions. The generation method and dimensions of each attention are as follows:

[0072] ;

[0073] Among them, the and These are the first attention weight and the second attention weight, respectively. It is the third attention weight. It is the kernel size. = = .

[0074] Furthermore, to compensate for the shortcomings of global attention in high-frequency detail modeling, the local high-resolution branch uses Conv1d and Sigmoid to perform cross-channel modeling of channel features, generating attention weights with higher resolution. Finally, the weights output by the three types of global attention, local attention, and frequency weight decomposition subunits are used to generate attention weights with higher resolution. Multi-level fusion weights are generated through element-wise multiplication. The fusion formula can be expressed as:

[0075] ;

[0076] Among them, the The modulated dynamic convolution weights; and These are the first attention weight and the second attention weight, respectively. It is the third attention weight; the stated For local attention weights; the These are the convolution weights.

[0077] The method provided in this embodiment involves a spatial modulation subunit generating an embedding tensor by performing global average pooling on the input feature map. Based on this embedding tensor, channel and spatial attention weights are generated through three independent two-dimensional convolutions and activation functions, and converted into a form consistent with the dimensions of the dynamic convolution kernel weight tensor. Simultaneously, one-dimensional convolutions and activation functions are used to model the channel features of the input feature map across channels to generate local attention weights. These three types of attention weights are then multiplied element-wise with the convolution weights to obtain the modulated dynamic convolution weights. This series of methods can effectively capture the cross-channel and cross-spatial global dependencies of targets in sonar images through the global attention branch, highlighting the features of key channels and important spatial locations. The first local branch accurately captures local detail features, enhancing the perception of local information such as target edges and textures. The fusion modulation of multi-dimensional attention weights and convolution weights allows the convolution weights to be dynamically adjusted according to the complex distribution of targets and backgrounds in the sonar image. This not only strengthens the extraction of effective target features but also suppresses the influence of interference factors such as strong echoes and noise, ultimately improving the model's recognition accuracy and detection robustness for various targets (especially blurred and low-contrast targets) in sonar images.

[0078] (3) The frequency band modulation subunit performs Fourier transform on the modulated dynamic convolution weights to obtain the spectrum representation, divides the spectrum sub-bands using a preset frequency band mask, completes the convolution calculation in the frequency domain, adjusts the frequency band response at different positions through the spatial attention map and fuses all sub-band features to output the preliminary processed features.

[0079] Specifically, the Frequency Band Modulation (FBM) subunit is a key subunit in the partial frequency dynamic convolution unit. Its main function is to perform sub-band division and processing of features in the frequency domain, and to adjust the frequency band response at different locations by combining spatial attention. This enables the fine-grained capture and integration of features of different frequency components in sonar images, enhances the detection model's ability to distinguish complex frequency distribution features, and in particular highlights the key features of the target in a specific frequency band, while suppressing the influence of noise and other interference frequency bands.

[0080] Optionally, the frequency band modulation subunit performs a Fourier transform on the modulated dynamic convolution weights to obtain a spectral representation, divides the spectral sub-bands using a preset frequency band mask, and after completing the convolution calculation in the frequency domain, adjusts the frequency band response at different positions through a spatial attention map and fuses all sub-band features to output preliminary processed features. This includes: performing a discrete Fourier transform on the dynamic convolution weights to obtain the corresponding spectral representation; dividing the spectral representation using a preset frequency band mask to obtain multiple non-overlapping frequency sub-bands; each frequency band mask takes a value of 1 only when the corresponding frequency falls within a preset threshold range, and takes a value of 0 when it does not fall within the preset threshold range, and the preset threshold is divided in a logarithmic proportional manner; performing convolution calculations on each frequency sub-band with the input feature map in the frequency domain to obtain the preliminary convolution results corresponding to each frequency sub-band; generating a spatial attention map from the input feature map through two-dimensional convolution and an activation function; weighting the preliminary convolution results of each frequency sub-band with the corresponding spatial attention map position by position; and fusing all spatially modulated frequency band features to obtain preliminary processed features.

[0081] In specific implementation, the modulated dynamic convolution weights output by the spatial modulation subunit are subjected to a Discrete Fourier Transform (DFT) to transform them from the spatial domain to the frequency domain, obtaining the corresponding spectral representation. The spectral representation is then divided using a preset frequency band mask: each frequency band mask uses binary values, taking a value of 1 when the corresponding frequency is within a preset threshold range, and 0 otherwise. The preset threshold is divided in a logarithmic proportional manner to adapt to the frequency distribution characteristics of the sonar image, resulting in multiple non-overlapping frequency sub-bands. In the frequency domain, each sub-band is convolved with the input feature map, processing different frequency components independently to obtain preliminary convolution results for each sub-band. Spatial features are extracted from the input feature map using a two-dimensional convolutional layer, and after activation function processing, a spatial attention map is generated. Subsequently, the preliminary convolution results of each frequency sub-band are weighted point-by-point with the spatial attention map according to their corresponding positions, enhancing the frequency band features at important spatial locations. All spatially modulated frequency band features are integrated and fused, summarizing the effective information of each sub-band, and finally outputting the preliminary processed features.

[0082] For example, in one embodiment, the band modulation subunit first adjusts the output weights of the spatial modulation subunit. Perform a discrete Fourier transform to obtain the spectral representation, and then use a set of predefined frequency band masks. The spectrum is divided into multiple non-overlapping frequency sub-bands. The weight of each frequency band is determined by the following formula:

[0083] ;

[0084] Among them, the and Representing DFT and iDFT respectively, The value is set to 1 only when the current frequency falls within the threshold range, indicating that it belongs to the b-th frequency band. The values ​​are set to 0 in all other positions. The frequency threshold is divided into {0, 1 / 16, 1 / 8, 1 / 4, 1 / 2} using logarithmic ratios.

[0085] Because realizing an ideal filter in the spatial domain involves an infinite support domain, the band modulation subunit performs convolution calculations in the frequency domain. The calculation expression is:

[0086] ;

[0087] Subsequently, the input feature map X is processed by 2D convolution and Sigmoid activation to generate a spatial attention map. This is used to adjust the frequency band response at different spatial locations. Each frequency band output... Then with the corresponding Position-by-position weighting is performed. The fusion formula for all frequency band modulations can be expressed as:

[0088] ;

[0089] Among them, the To output a feature map; the The number of frequency bands; This is a spatial attention map; Output for each frequency band.

[0090] The method provided in this embodiment obtains the spectral representation by performing a discrete Fourier transform on the modulated dynamic convolution weights in the frequency band modulation subunit. Multiple non-overlapping frequency subbands are divided using a preset frequency band mask (a preset threshold range divided logarithmically, with the mask set to 1 within the range and 0 outside the range). Each subband is convolved with the input feature map in the frequency domain to obtain preliminary results. Then, a spatial attention map generated by two-dimensional convolution and activation function on the input feature map is used to weight the preliminary results of each subband positionally. Finally, all subband features are fused to output preliminary processed features, enabling the detection model to capture different frequencies in sonar images with fine precision at the frequency domain level. The logarithmically proportional frequency band mask adapts to the frequency distribution characteristics of sonar signals, enabling targeted extraction of key information of targets in specific frequency bands while suppressing the influence of noise and other interference bands. The position-wise weighting of the spatial attention map adjusts the frequency band response according to the feature importance of different spatial locations, strengthening the effective frequency band features of the target area and weakening redundant information in the background area. Finally, the fusion of multi-subband features improves the model's ability to identify targets with complex frequency distributions in sonar images, especially in scenarios where target and background frequency features are mixed, enabling more accurate target location and identification, and improving the accuracy and robustness of sonar target detection.

[0091] Specifically, Figure 4This is a schematic diagram of the MSDA module provided in this application. Please refer to... Figure 4 The MSDA module normalizes and expands the input features to obtain the first and second features. It extracts spatial attention features from the first feature through depthwise convolutions of different directions and sizes. Attention modulation and fusion are performed on the convolutional features from multiple receptive fields. The fused feature is then multiplied element-wise with the second feature. This process includes: normalizing the input features; expanding the feature channel number through pointwise convolutions; splitting the expanded features along the channel dimension into the first and second features; splitting the second feature along the channel dimension into multiple sub-branches; performing convolution operations of different directions and sizes on each sub-branch; concatenating and fusing the processed sub-branches along the channel dimension to generate spatial attention features; setting up multi-scale parallel branches containing a corresponding number of receptive fields based on the multiple sub-branches; multiplying the input feature map with the spatial attention feature element-wise on each scale branch; concatenating and fusing the modulation results of each scale branch to obtain a multi-scale spatial attention feature map; multiplying the multi-scale spatial attention feature map with the first feature element-wise; and performing a residual connection between the multiplication result and the original input feature map to output the final processed feature.

[0092] In practice, the input features are first normalized to eliminate the impact of differences in feature scales. Then, the number of feature channels is expanded using pointwise convolution (1x1 convolution) to increase the feature dimension and accommodate more information. The expanded features are then divided into two parts along the channel dimension, serving as the first and second features respectively. The second feature is further subdivided into several sub-branches along the channel dimension. For each sub-branch, depthwise convolutions of different directions (e.g., horizontal, vertical, diagonal) and sizes (e.g., 1x3, 3x1, 3x3, 5x5) are applied to ensure each sub-branch focuses on capturing features of a specific direction and scale. Finally, the convolutional features from all sub-branches are concatenated along the channel dimension to form a spatial attention feature containing multi-directional, multi-scale information. A corresponding number of multi-scale parallel branches are set according to the number of sub-branches, with each branch corresponding to a different receptive field (controlled by convolutional kernel size or dilation rate) to adapt to targets of different sizes. In each scale branch, the input feature map is multiplied element-wise with spatial attention features to modulate the input features and highlight important information. Then, the modulation results of all scale branches are concatenated and fused along the channel dimension to obtain a multi-scale spatial attention feature map that integrates information from multiple receptive fields. The multi-scale spatial attention feature map is multiplied element-wise with the first feature to deeply integrate the attention information with the basic features. Finally, the multiplication result is residually concatenated (element-wise addition) with the original input feature map of the MSDA module, incorporating newly extracted features while retaining the original feature information, and outputting the final processed feature.

[0093] For example, in one embodiment, firstly, the input features are... LayerNormalization is applied, followed by channel expansion using PWConv, increasing the number of feature channels from C to 2C. The expanded features are then divided into two parts along the channel dimension, denoted as follows: and The processing procedure is as follows:

[0094] ;

[0095] Among them, the and These are the first feature and the second feature, respectively; For input features.

[0096] Subsequently, The algorithm is further divided into four sub-branches along the channel dimension to perform spatial attention computation and multi-scale feature extraction tasks in parallel. Spatial attention consists of InceptionDWConv and PWConv. InceptionDWConv first... k( ) Dividing it into 4 branches along the channel dimension yields Then, different depthwise convolution operations are applied to each sub-branch. Applying 3×3 depthwise convolutions focuses on capturing spatial features of local neighborhoods, branching... A 1×11 depthwise convolution is used to extract long-range dependent spatial features along the width direction, branching. Long-range dependent spatial features are extracted along the height direction using an 11×1 depthwise convolution. (Processed) , , With branches The data is concatenated and fused along the channel dimension, and finally channel blending and feature enhancement are achieved through PWConv. The spatial attention branch processing is as follows:

[0097] ;

[0098] Among them, the The second feature; It consists of four branches; This is a multi-scale spatial attention feature map.

[0099] The multi-scale parallel branches include convolutional operations with four receptive fields: 3×3, 5×5, 7×7, and 9×9, to capture spatial information at different scales. At each scale branch, the input feature map is element-wise multiplied with the spatial attention map to achieve attention modulation, and the final output feature map is fused. It is obtained from the following operational expression:

[0100] ;

[0101] Among them, the The feature map output by fusion; The first feature; This is a multi-scale spatial attention feature map. When k' is 1, 2, 3, or 4, it corresponds to four types of convolution kernels: 3×3, 5×5, 7×7, and 9×9.

[0102] After fusion, the multi-scale spatial attention feature maps are stitched together with... Element-wise multiplication is performed, and channel blending and feature enhancement are achieved using PWConv. Finally, the enhanced feature map is residually concatenated with the original input feature map to obtain the module's final output feature map. It is obtained from the following operational expression:

[0103] ;

[0104] Among them, the For final processing features; the The first feature; The original input feature map; The feature map output by fusion.

[0105] The method provided in this embodiment, MSDA The module stabilizes the feature distribution by normalizing the input features, expands the number of channels through pointwise convolution, and then splits them into first and second features. The second feature is further divided into multiple sub-branches, and features are extracted using convolution operations of different directions and sizes. These sub-branches are then concatenated and fused to generate spatial attention features. Based on the sub-branches, multi-scale parallel branches with corresponding numbers of receptive fields are set up. In each branch, the input features are modulated with spatial attention features and fused to obtain a multi-scale spatial attention feature map. Finally, the map is multiplied with the first feature and connected to the residual of the original input features to output the final feature. This allows the MSDA module to capture the directional characteristics and detailed information of targets in sonar images through multi-directional and multi-size convolutions, enhancing the feature perception of targets with different shapes. The multi-scale parallel branches adapt to the scale changes of sonar targets, highlight the effective target features at each scale through attention modulation, and suppress background interference in complex marine environments. The residual connection preserves the original feature information and alleviates the gradient vanishing problem. Overall, the model's ability to detect multi-scale and multi-shaped targets in sonar images is improved, especially in scenarios where targets are affected by noise and echo interference, enabling more accurate identification and localization of targets and improving detection accuracy and robustness.

[0106] Specifically, Figure 5 This is a schematic diagram of the C2DYT module provided in this application. Please refer to... Figure 5 The C2DYT module performs nonlinear compression of features at the input of the attention path using a first dynamic activation layer, and performs dynamic range compression and channel-level affine adjustment of features before the feedforward convolution using a second dynamic activation layer. This includes: at the input of the attention path, the first dynamic activation layer performs nonlinear compression of the input features using a dynamic activation function, controlling the degree of compression through a globally learnable scalar; the feature values ​​corresponding to the extreme echo signals are within the saturation range; after attention calculation and before feedforward convolution, the second dynamic activation layer performs dynamic range compression and channel-level affine adjustment of the features using a dynamic activation function, compressing the overall dynamic range of the features through a globally learnable scalar, adjusting the amplitude differences between channels through scaling parameters of each channel, and calibrating the channel mean through offset parameters; after two layers of dynamic activation processing, the processed features are added to the original input features through residual connections to output the final processed features.

[0107] In practice, a first dynamic activation layer is deployed at the input of the attention path. This layer uses a dynamic activation function to perform non-linear compression on the input features. During this process, a globally learnable scalar is set as a parameter for model training. Its value directly determines the degree of feature compression. By adjusting the learnable scalar, the feature values ​​corresponding to extreme echo signals are compressed to a preset saturation range, ensuring that extreme signal features do not excessively affect subsequent processing. After completing the attention calculation step and before performing the feedforward convolution operation, a second dynamic activation layer is activated. This layer also uses a dynamic activation function to process features. First, a globally learnable scalar is introduced to compress the overall dynamic range of the features, reducing the fluctuation amplitude of feature values. Then, scaling parameters are configured individually for each channel to adjust the amplitude differences between different channels and balance the importance of features in each channel. Finally, offset parameters are set for each channel to calibrate the mean of each channel and optimize the channel feature distribution. These three operations together achieve dynamic range compression and channel-level affine adjustment of the features. After continuous processing by the first and second dynamic activation layers, a residual connection mechanism is used to add the features obtained from the two layers of processing to the original input features initially received by the C2DYT module element by element, integrating the original feature information with the processed feature information, and finally outputting the final processed feature of the module.

[0108] For example, in one embodiment, the first dynamic activation layer and the second dynamic activation layer can be represented as:

[0109] ;

[0110] in, For each channel, learnable scaling and offset parameters; It is a globally learnable scalar; , For input and output.

[0111] The method provided in this embodiment effectively suppresses the interference of extreme echoes (such as strong reflection noise) in sonar images on feature extraction through the first dynamic activation layer, avoiding extreme signals from dominating feature learning. The second dynamic activation layer optimizes feature distribution and balances the importance of features in each channel through dynamic range compression and channel-level affine adjustment, enhancing the ability to capture effective target features. The residual connection preserves the original feature information and ensures the integrity of feature transmission. Overall, it improves the detection model's ability to identify targets affected by strong echoes in complex marine environments, reduces the impact of noise on detection results, and improves the accuracy and stability of sonar target detection.

[0112] S103. Input the sonar image to be detected into the trained detection model and output the target detection result.

[0113] Specifically, the target detection result includes detailed information about the detected targets in the sonar image, mainly including the target's location (usually presented as bounding box coordinates, such as the pixel coordinates of the top left and bottom right corners), the target's category (i.e., what type of target it is, such as fish, reef, shipwreck, etc.), and the corresponding target's confidence score (reflecting the reliability of the detection model's detection result for that target, usually represented by a value between 0 and 1). This information collectively constitutes the detection model's identification and localization results for targets in the input sonar image, intuitively presenting the targets present in the sonar image and their related attributes.

[0114] In specific implementation, according to the input specifications of the detection model, the preprocessed sonar image data is converted into a tensor form that the model can read (e.g., converted into an array that conforms to the model's input dimensions). The trained detection model is then called, and the converted sonar image tensor is passed into the detection model as input. After receiving the input, the detection model sequentially performs internal calculations such as feature extraction (e.g., feature processing through the aforementioned C3k2_SFD module, MSDA module, and C2DYT module), feature fusion, target localization, and classification. After completing the calculations, the detection model outputs the target detection result. The working principle of the detection model can be referred to in the above embodiments and the description in the prior art, and will not be repeated here.

[0115] The method provided in this embodiment, firstly, involves three modules that collaborate and innovate from different dimensions. The C3k2_SFD module focuses on the refined processing of frequency and spatial features, the MSDA module focuses on capturing multi-scale and directional features, and the C2DYT module focuses on noise suppression and feature distribution optimization. The combination of these three modules comprehensively improves the detection model's ability to detect sonar targets in complex marine environments. This enhances the specificity and richness of feature extraction, improves adaptability to changes in target morphology, and reduces noise interference, achieving an overall improvement in detection accuracy and robustness. Secondly, the C3k2_SFD module maps the convolution kernel weights to the frequency domain through frequency weight decomposition and divides the set according to frequency modulus. After inverse discrete Fourier transform, the weights are recombined into convolution weights. Combined with spatial modulation, dynamic convolution weights are generated. Then, sub-band features are adjusted through frequency band modulation and spatial attention maps. This method can accurately capture features of different frequency components, adapt to the frequency distribution of sonar signals, highlight key frequency band information of the target, suppress interference, and enhance the ability to distinguish between target and background frequency differences. Thirdly, the MSDA module normalizes and expands the input features before splitting them. It extracts spatial attention features through depthwise convolutions of different directions and sizes, and combines multiple receptive field features with multi-scale parallel branches to multiply them with another feature. This approach can effectively capture target features of different scales and directions, adapt to changes in target morphology, strengthen effective features, and suppress background interference, thus improving the detection capability for multi-scale and multi-morphological targets. Fourthly, the C2DYT module uses a first dynamic activation layer to nonlinearly compress features to control extreme echo features, and a second dynamic activation layer to perform dynamic range compression and channel-level affine adjustment. Combined with residual connections, this method can suppress extreme noise interference, optimize feature distribution, balance channel importance, avoid strong echoes dominating feature learning, retain original feature information, reduce the impact of noise on detection results, and improve detection accuracy and stability.

[0116] Corresponding to the aforementioned embodiment of a sonar target detection method for complex marine environments, this application also provides an embodiment of a sonar target detection device for complex marine environments.

[0117] Figure 6 This is a schematic diagram of the sonar target detection device for complex marine environments provided in Embodiment 2 of this application. Please refer to... Figure 6 The apparatus provided in this embodiment includes a construction module 210, a training module 220, and an output module 230;

[0118] The construction module 210 is used to construct a sonar image dataset;

[0119] The training module 220 is used to train the detection model using the sonar image dataset to obtain a trained detection model.

[0120] The detection model includes the C3k2_SFD module, the MSDA module, and the C2DYT module. The C3k2_SFD module maps the convolutional kernel weights to the frequency domain through frequency weight decomposition, divides the frequency set according to the frequency modulus, maps each frequency set back to the spatial domain, and reassembles them into convolutional weights. Based on the convolutional weights, global attention branches and local branches are constructed through spatial modulation and fused to generate modulated dynamic convolutional weights. Based on the dynamic convolutional weights, a spectral representation is obtained through frequency band modulation. The spectral sub-bands are divided using a preset frequency band mask. The frequency band response at different positions is adjusted through the spatial attention map generated by the input feature map, and all sub-band features are fused.

[0121] The MSDA module normalizes and expands the input features to obtain the first feature and the second feature. It extracts the spatial attention features of the first feature through depth convolution with different directions and sizes, performs attention modulation and fusion on the convolution features of multiple receptive fields, and multiplies the fused features element-wise with the second feature.

[0122] The C2DYT module performs non-linear compression of features at the input end of the attention path through the first dynamic activation layer, and performs dynamic range compression and channel-level affine adjustment of features before the feedforward convolution through the second dynamic activation layer.

[0123] The output module 230 is used to input the sonar image to be detected into the trained detection model and output the target detection result.

[0124] The apparatus of this embodiment can be used to perform... Figure 1 The steps of the method embodiment shown are similar in principle and process, and will not be repeated here.

[0125] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0126] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and 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 application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0127] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A sonar target detection method for complex marine environments, characterized in that, The method includes: Construct a sonar image dataset; The detection model is trained using a sonar image dataset to obtain a trained detection model; The detection model includes the C3k2_SFD module, the MSDA module, and the C2DYT module. The C3k2_SFD module maps the convolutional kernel weights to the frequency domain through frequency weight decomposition, divides the frequency set according to the frequency modulus, maps each frequency set back to the spatial domain, and reassembles them into convolutional weights. Based on the convolutional weights, a global attention branch and a first local branch are constructed through spatial modulation and fused to generate modulated dynamic convolutional weights. Based on the dynamic convolutional weights, a spectral representation is obtained through frequency band modulation, and the spectral sub-bands are divided using a preset frequency band mask. The frequency band response at different positions is adjusted through the spatial attention map generated by the input feature map, and all sub-band features are fused. The MSDA module normalizes and expands the input features to obtain the first feature and the second feature. It extracts the spatial attention features of the first feature through depth convolution with different directions and sizes, performs attention modulation and fusion on the convolution features of multiple receptive fields, and multiplies the fused features element-wise with the second feature. The C2DYT module performs non-linear compression of features at the input end of the attention path through the first dynamic activation layer, and performs dynamic range compression and channel-level affine adjustment of features before the feedforward convolution through the second dynamic activation layer. The sonar image to be detected is input into the trained detection model, and the target detection result is output.

2. The method according to claim 1, characterized in that, The C3k2_SFD module includes a partial frequency dynamic convolution unit, a first pointwise convolution unit, and a second pointwise convolution unit connected in sequence. After receiving the input feature map, the frequency dynamic convolution unit performs frequency dynamic modeling on the target channel, maps the convolution kernel weights to the frequency domain and divides the frequency set, reorganizes them into convolution weights through inverse discrete Fourier transform, establishes the first global feature and the first local feature by combining spatial modulation, and outputs the preliminary processed features through frequency band modulation. The first pointwise convolutional unit receives the preliminary processed features output by the partial frequency dynamic convolutional unit, expands the feature channels using a dual-channel expansion strategy, and enhances the nonlinear expressive power of the features by combining batch normalization and activation functions. The second pointwise convolutional unit receives the expanded features output by the first pointwise convolutional unit, compresses the number of channels back to the original size, adds it to the initial input feature map of the C3k2_SFD module through residual connections, and outputs the final processed features.

3. The method according to claim 2, characterized in that, The partial frequency dynamic convolution unit includes a frequency weight decomposition subunit, a spatial modulation subunit, and a frequency band modulation subunit connected in sequence. The frequency weight decomposition subunit maps the convolution kernel weights to the frequency domain to obtain a learnable spectrum matrix, divides the frequency index set according to the frequency magnitude, applies the inverse discrete Fourier transform to each set to map it back to the spatial domain and reassembles it into convolution weights. The spatial modulation subunit, based on the convolution weights, establishes first global features across channels and across spaces through a global attention branch, captures first local features through a first local branch, and fuses them to generate modulated dynamic convolution weights. The frequency band modulation subunit performs a Fourier transform on the modulated dynamic convolution weights to obtain a spectral representation. It divides the spectral sub-bands using a preset frequency band mask. After completing the convolution calculation in the frequency domain, it adjusts the frequency band response at different positions through a spatial attention map and fuses all sub-band features to output preliminary processed features.

4. The method according to claim 3, characterized in that, The step of applying the inverse discrete Fourier transform to each set to map it back to the spatial domain and reconstruct it into convolutional weights includes: For each set of frequency indices, a two-dimensional inverse discrete Fourier transform is applied to map the spectral coefficients in the frequency domain back to the spatial domain to obtain the corresponding spatial domain parameters. The spatial domain parameters are reorganized to form the first convolution weights; The input feature map is subjected to global average pooling, and a set of dynamic attention coefficients are generated through a fully connected layer and activation function; The dynamic attention coefficients are weighted together with the first convolution weights to obtain the final convolution weights used for feature extraction.

5. The method according to claim 3, characterized in that, The spatial modulation subunit, based on the aforementioned convolutional weights, establishes first global features across channels and space through a global attention branch, captures first local features through a first local branch, and fuses them to generate modulated dynamic convolutional weights, including: Global average pooling is performed on the input feature map to generate an embedding tensor; Based on the embedding tensor, three independent two-dimensional convolutions and activation functions are used to generate a first attention weight based on the input channel, a second attention weight based on the output channel, and a third attention weight oriented towards spatial location, respectively. The attention weights are then uniformly converted into a form consistent with the dimension of the dynamic convolution kernel weight tensor. One-dimensional convolution and activation functions are used to model the channel features of the input feature map across channels, generating local attention weights; The first attention weight, the second attention weight, the third attention weight, and the local attention weight are multiplied element-wise with the convolution weight to obtain the modulated dynamic convolution weight.

6. The method according to claim 3, characterized in that, The frequency band modulation subunit performs a Fourier transform on the modulated dynamic convolution weights to obtain a spectral representation. It then divides the spectral sub-bands using a preset frequency band mask. After completing the convolution calculation in the frequency domain, it adjusts the frequency band response at different locations using a spatial attention map and fuses all sub-band features to output preliminary processed features, including: Perform a discrete Fourier transform on the dynamic convolution weights to obtain the corresponding spectral representation; The spectrum representation is divided using a preset frequency band mask to obtain multiple non-overlapping frequency sub-bands; each frequency band mask takes a value of 1 only when the corresponding frequency is within a preset threshold range, and takes a value of 0 when it is not within the preset threshold range, and the preset threshold is divided in a logarithmic proportional manner; In the frequency domain, each frequency sub-band is convolved with the input feature map to obtain the preliminary convolution results for each frequency sub-band. The input feature map is processed by two-dimensional convolution and activation function to generate a spatial attention map. The preliminary convolution result of each frequency sub-band is weighted positionally with the corresponding spatial attention map. All spatially modulated frequency band features are fused to obtain the preliminary processed features.

7. The method according to claim 1, characterized in that, The MSDA module normalizes and expands the input features to obtain the first and second features. It then extracts spatial attention features from the first feature through depthwise convolutions of different directions and sizes. Attention modulation and fusion are performed on convolutional features from multiple receptive fields. The fused feature is then multiplied element-wise with the second feature, including: The input features are normalized, and the number of feature channels is expanded by pointwise convolution. The expanded features are split into first features and second features along the channel dimension, and the second features are split into multiple sub-branches along the channel dimension. Convolutional operations with different directions and sizes are performed on multiple sub-branches, and the processed sub-branches are spliced ​​and fused in the channel dimension to generate spatial attention features. Based on multiple sub-branches, a multi-scale parallel branch with a corresponding number of receptive fields is set up. On each scale branch, the input feature map is multiplied with the spatial attention feature element by element. The modulation results of each scale branch are spliced ​​and fused to obtain a multi-scale spatial attention feature map. The multi-scale spatial attention feature map is multiplied element-wise with the first feature map, and the multiplication result is residually connected with the original input feature map to output the final processed feature map.

8. The method according to claim 1, characterized in that, The C2DYT module performs non-linear compression of features at the input of the attention path using a first dynamic activation layer, and performs dynamic range compression and channel-level affine adjustment of features before the feedforward convolution using a second dynamic activation layer, including: At the input end of the attention path, the first dynamic activation layer performs nonlinear compression on the input features through a dynamic activation function, and controls the degree of compression through a globally learnable scalar; the feature values ​​corresponding to the extreme value echo signal are within the saturation range; After attention calculation and before feedforward convolution, the second dynamic activation layer performs dynamic range compression and channel-level affine adjustment on the features through a dynamic activation function. It compresses the overall dynamic range of the features through a globally learnable scalar, adjusts the amplitude difference between channels through the scaling parameters of each channel, and calibrates the channel mean through the offset parameter. After two layers of dynamic activation processing, the processed features are added to the original input features through residual connections to output the final processed features.

9. The method according to claim 1, characterized in that, The construction of the sonar image dataset includes: Collect sonar images in real marine environments; the sonar images cover a variety of scenes, interference factors, and underwater targets; The collected sonar images are preprocessed; The preprocessed sonar images are divided into training, validation, and test sets according to a preset ratio to obtain a sonar image dataset.

10. A sonar target detection device for complex marine environments, characterized in that, The device includes a construction module, a training module, and an output module; The construction module is used to construct a sonar image dataset; The training module is used to train the detection model using a sonar image dataset to obtain a trained detection model. The detection model includes the C3k2_SFD module, the MSDA module, and the C2DYT module. The C3k2_SFD module maps the convolutional kernel weights to the frequency domain through frequency weight decomposition, divides the frequency set according to the frequency modulus, maps each frequency set back to the spatial domain, and reassembles them into convolutional weights. Based on the convolutional weights, global attention branches and local branches are constructed through spatial modulation and fused to generate modulated dynamic convolutional weights. Based on the dynamic convolutional weights, a spectral representation is obtained through frequency band modulation. The spectral sub-bands are divided using a preset frequency band mask. The frequency band response at different positions is adjusted through the spatial attention map generated by the input feature map, and all sub-band features are fused. The MSDA module normalizes and expands the input features to obtain the first feature and the second feature. It extracts the spatial attention features of the first feature through depth convolution with different directions and sizes, performs attention modulation and fusion on the convolution features of multiple receptive fields, and multiplies the fused features element-wise with the second feature. The C2DYT module performs non-linear compression of features at the input end of the attention path through the first dynamic activation layer, and performs dynamic range compression and channel-level affine adjustment of features before the feedforward convolution through the second dynamic activation layer. The output module is used to input the sonar image to be detected into the trained detection model and output the target detection result.

Citation Information

Patent Citations

  • Sonar target identification system based on residual network

    CN120428212A

  • Lightweight remote sensing target detection method and system

    CN120708092A

  • Model training and scene recognition method and apparatus, device, and medium

    WO2023056889A1

Cited By

  • Sonar intelligent interpretation method and system

    CN121114983A