Underwater sound source localization model and method based on CNN-Transform and double attention mechanism

By combining CNN-Transformer with a dual attention mechanism, an underwater sound source localization model was developed, which solved the problem of insufficient sound source localization accuracy in the marine environment and achieved high-precision and robust sound source localization results.

CN121544858APending Publication Date: 2026-02-17ZHONGBEI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511642211.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing underwater sound source localization methods, when dealing with marine environments, struggle to effectively leverage the advantages of Transformers in capturing long-range dependencies while avoiding damage to the physical structure of the input data, resulting in insufficient localization accuracy and robustness.

Method used

An underwater sound source localization model based on CNN-Transformer and dual attention mechanism is adopted. Through feature extraction module, pixel-level channel attention module, Transformer modeling module and dynamic big kernel spatial attention module, combined with a multi-task learning framework, high-precision estimation of sound source distance and depth is achieved.

Benefits of technology

It effectively maintains the topological structure of the spatial covariance matrix, enhances the representation of direct path features, restores the detailed features of the sound field, improves spatial resolution, and achieves efficient mapping from raw sound field data to high-precision positioning results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544858A_ABST
    Figure CN121544858A_ABST
Patent Text Reader

Abstract

The invention discloses an underwater sound source localization model and method based on CNN-Transform and a double attention mechanism, and the model comprises a feature extraction module which is used for extracting the local features of the underwater sound source space covariance matrix tensor; the pixel-level channel attention module is used for re-calibrating the extracted local feature channel to obtain re-calibrated features; the Transform modeling module is used for introducing self-adaptive two-dimensional position coding into a Transform encoder based on the characteristics of the re-calibration, and capturing global context information by using the Transform encoder so as to obtain output characteristics; the dynamic large kernel space attention module captures an array space mode and fine features in positioning based on the output features to obtain a feature map; and the prediction module is used for estimating the sound source distance and depth based on the feature map. By adopting the model and the method, spectrum diffusion interference and feature degradation are cooperatively inhibited through double attention mechanisms, and a new scheme is provided for realizing high-precision sound source localization in a complex marine environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of marine monitoring and defense, and in particular relates to an underwater sound source localization model and method based on CNN-Transformer and dual attention mechanism. Background Technology

[0002] Passive localization of underwater acoustic sources is a key technology for marine monitoring and national defense. Classical methods, such as matched field processing (MFP), while theoretically mature, heavily rely on accurate modeling of the marine environment. However, the inherent spatiotemporal dynamics of the marine environment make accurate modeling extremely difficult to achieve in practice. The resulting "model mismatch" problem has become a core bottleneck restricting its application effectiveness, prompting a shift in research paradigms towards data-driven methods that rely less on prior environmental information.

[0003] Since 2017, data-driven localization methods have undergone a rapid evolution from traditional machine learning to deep learning. Early research, through nonlinear regression, feedforward neural networks (FNNs), and generalized regression networks (GRNNs), initially verified the feasibility of surpassing MFPs in specific scenarios. Subsequently, deep learning models, represented by convolutional neural networks (CNNs), became mainstream. Researchers have deepened model architectures by constructing deeper networks (such as 50-layer residual networks), designing end-to-end hybrid architectures, and introducing semi-supervised learning. They have also focused on improving the generalization and application capabilities of these models, such as enhancing noise adaptability, addressing overfitting, and verifying the feasibility of direct localization. In particular, the introduction of multi-task learning (MTL) frameworks has made joint estimation of distance and depth possible. However, most of these methods rely on the inherent local receptive field of CNNs, which has inherent limitations in capturing the long-range spatial dependencies that are crucial for sound source localization and span the entire array aperture.

[0004] To overcome this bottleneck, recent research has begun to combine multi-task learning with more advanced deep architectures, particularly focusing on the Transformer architecture, which excels in global modeling. However, new and deeper challenges arise: when dealing with covariance matrices (SCMs) with well-defined physical structures, the data-independent positional encoding mechanism used by standard Transformers can disrupt the inherent Hermitian symmetry of SCMs, leading to the loss of crucial physical information. Therefore, the core challenge in the current field lies in how to effectively leverage the Transformer's advantage in capturing long-range dependencies while avoiding its disruption of the physical structure of the input data, and further intelligently refine features from the channel and spatial dimensions. Summary of the Invention

[0005] The purpose of this invention is to provide an underwater sound source localization model and method based on CNN-Transformer and dual attention mechanism to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, this invention provides an underwater sound source localization model based on CNN-Transformer and dual attention mechanism, including a feature extraction module, a pixel-level channel attention module, a Transformer modeling module, a dynamic large kernel spatial attention module, and a prediction module; The feature extraction module extracts local features from the spatial covariance matrix tensor of the underwater sound source to obtain an abstract feature map. ; The pixel-level channel attention module is based on abstract feature maps. The extracted local feature channels are recalibrated to obtain recalibrated features. ; The Transformer modeling module is based on recalibrated features. Adaptive two-dimensional positional encoding is introduced into the Transformer encoder. The Transformer encoder is used to serialize features, capture global context information, and obtain output features. ; The dynamic large-kernel spatial attention module, based on output features Capture the spatial patterns and subtle features of the array during localization to obtain feature maps. ; The prediction module is based on feature maps. A multi-task learning framework is used to estimate the distance and depth of the sound source.

[0007] Preferably, the recalibrated features are... include: First, global average pooling is used to compress the two-dimensional spatial information of each channel into a scalar descriptor. The formula is: ; In the formula, These represent the number of channels, height, and width of the feature map, respectively. Represents a two-dimensional spatial location; Then, the scalar descriptor passes through two cascaded convolutional layers to learn the non-linear dependencies between channels and generate a normalized channel weight vector. The formula is: ; In the formula, It is the GELU activation function. It is the Sigmoid activation function; Channel weight vector Apply to the abstract feature map via channel-by-channel multiplication. The recalibrated features are obtained. The formula is: .

[0008] Preferably, the obtained output features include: Introducing adaptive two-dimensional position coding to convert two-dimensional spatial position Decompose and index into rows and column indexes Create learnable nested tables separately. and any position Position encoding It is generated by adding the learned row and column embedding vectors, and the formula is: ; Feature map It is flattened into a feature sequence and coupled with an adaptive two-dimensional positional encoding matrix. Add them together to form the input sequence. The formula is: ; Feature sequences after flattening and position encoding The input sequence is fed into a single- or multi-layer Transformer encoder, where, in the self-attention layer, it is linearly projected into the query sequence. ,key Sum Triples, multi-head self-attention mechanisms will query ,key Sum The segmentation focuses on different representational subspaces of the input sequence for each head. The outputs of all heads are concatenated and then subjected to another linear transformation to form the final output feature of this layer. .

[0009] Preferably, the obtained feature map include: First, a series of depthwise separable convolutions and dilated convolutions are used to simulate a large receptive field, and then a spatial attention map is dynamically generated. The formula is: ; In the formula, This represents depthwise separable convolution. Indicates dilated convolution; Then, Based on spatial attention graph Dynamic enhancement is achieved, and the final refined feature map is output. The formula is: .

[0010] Preferably, the prediction module specifically includes: feature maps After global average pooling, the data is fed into two parallel regression heads to predict distances. and depth .

[0011] Preferably, the prediction module employs a loss function based on uncertainty weighting, with the following formula: ; In the formula, and It is a learnable parameter that characterizes the uncertainty of the task. The network represents the distance to the sound source. Represents the actual distance to the sound source. The network predicts the depth of the sound source. Represents the depth of the actual sound source.

[0012] This invention also provides an underwater sound source localization method based on CNN-Transformer and dual attention mechanism, the steps of which include: S1. Preprocess the frequency domain sound pressure data received by the hydrophone to obtain the underwater sound source spatial covariance matrix tensor. S2. Construct an underwater sound source localization model based on CNN-Transformer and dual attention mechanism; S3. Based on the underwater sound source spatial covariance matrix tensor, train the model constructed in step S2 to predict the distance and depth of underwater sound sources.

[0013] Preferably, the preprocessing of the frequency domain sound pressure data received by the hydrophone in S1 includes: S11, for each frequency Construct its corresponding complex sound pressure vector ,in, Indicates the number of hydrophones. Indicates the number of discrete frequency points; S12, Calculate the frequency at this frequency dimensional space covariance matrix The formula is: ; In the formula, This indicates the conjugate transpose. For the expected operation, It is a Hermitian matrix whose elements The first one was precisely encoded The and the first A hydrophone receives a signal at a frequency Cross-correlation on; S13, convert each complex covariance matrix Decomposed into its real part matrix and imaginary part matrix The real and imaginary matrices of all frequencies are stacked to form a multi-channel real feature map; S14. Standardize the feature map to obtain the underwater sound source spatial covariance matrix tensor. .

[0014] Preferably, the stacking formula is: .

[0015] Therefore, the underwater sound source localization model and method based on CNN-Transformer and dual attention mechanism described above have the following beneficial effects: 1. Construct a CNN-Transformer hybrid architecture, introducing a Transformer module with learnable two-dimensional positional encoding to effectively maintain the spatial topological structure and conjugate symmetry of the spatial covariance matrix; 2. Design a pixel-level channel attention (PPA) module to enhance the representation of direct path features and suppress interference noise; 3. A Dynamic Large Kernel Spatial Attention (D-LKA) module is proposed to restore the detailed features of the sound field and improve spatial resolution; 4. Through close collaboration among its modules, the entire model can accurately extract discriminative features strongly correlated with the location of the sound source from complex sound field data, achieving efficient mapping from raw sound field data to high-precision positioning results.

[0016] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0017] Figure 1 This is a model architecture diagram of an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the construction of the spatial covariance matrix tensor according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a simulation experiment of Embodiment 1 of the present invention; Figure 4 The following are convergence curves of different models in Embodiment 1 of the present invention; Figure 5 These are the underwater positioning results of different models in Embodiment 1 of the present invention; Figure 6This is a performance comparison chart of different models in Embodiment 1 of the present invention; Figure 7 This is a diagram showing the location of the hydrophone and the sound source in event s5 of Embodiment 1 of the present invention; Figure 8 This is a schematic diagram of marine environmental parameters according to Embodiment 1 of the present invention; Figure 9 These are the underwater positioning results of different models in Embodiment 1 of the present invention; Figure 10 This is a graph showing the impact of the number of frequency points on performance in Embodiment 2 of the present invention; Figure 11 This is a graph showing the effect of the number of heads on performance in Embodiment 2 of the present invention; Figure 12 The figure shows the ablation experiment results of Example 3 of the present invention. Figure 13 This is a comparison chart of the ablation experiment results of Example 3 of the present invention. Detailed Implementation

[0018] Example like Figure 1 As shown, the underwater sound source localization model based on CNN-Transformer and dual attention mechanism includes a feature extraction module, a pixel-level channel attention module, a Transformer modeling module, a dynamic large-kernel spatial attention module, and a prediction module. The functions of each module are as follows: The feature extraction module extracts local features from the spatial covariance matrix tensor of underwater sound sources to obtain an abstract feature map. Specifically: A CNN backbone based on a residual network is used as the initial feature extractor to extract the basic acoustic features from the input 3D underwater sound source spatial covariance matrix (SCM) tensor, and then combine them into an abstract feature map. The formula is: ; In the formula, It is the input SCM tensor. The number of discrete frequency points. The number of array elements, and the output feature map middle, These represent the number of channels, height, and width of the feature map, respectively.

[0019] It should be noted that the ResNet used in this embodiment is a version specifically tuned for this task, which retains the stability of residual learning while... Convolutional replacement standard Convolutional and pooling configurations are used to preserve high-resolution interference details to the maximum extent. Furthermore, to provide a feature map rich in spatial information, downsampling with a stride of 2 is performed only once in the shallowest layers (layer 2), while subsequent deeper layers (layer 3, layer 4) use convolutions with a stride of 1 to maintain the resolution of the feature map. The output feature map... middle, These represent the number of channels, height, and width of the feature map, respectively.

[0020] Pixel-level channel attention module (PPA), based on abstract feature maps The extracted local feature channels are recalibrated to obtain recalibrated features. Specifically: PPA first compresses the two-dimensional spatial information of each channel into a scalar descriptor using global average pooling (GAP). The formula is: ; In the formula, These represent the number of channels, height, and width of the feature map, respectively. Represents a two-dimensional spatial location; Then, the scalar descriptor is passed through two cascaded 1x1 convolutional layers to learn the non-linear dependencies between channels and generate a normalized channel weight vector. The formula is: ; In the formula, It is the GELU activation function. It is the Sigmoid activation function; Channel weight vector Apply to the abstract feature map via channel-by-channel multiplication. The recalibrated features are obtained. The formula is: .

[0021] In this way, the PPA module achieves dynamic enhancement of key information channels and suppression of redundant channels, constituting the first intelligent screening of input information.

[0022] Transformer modeling module, based on recalibrated features Adaptive two-dimensional positional encoding is introduced into the Transformer encoder. The Transformer encoder is used to serialize features, capture global context information, and obtain output features. Specifically: Introducing adaptive two-dimensional position coding to convert two-dimensional spatial position Decompose and index into rows and column indexes Create learnable nested tables separately. and any position Position encoding It is generated by adding the learned row and column embedding vectors, and the formula is: ; Feature map It is flattened into a feature sequence and coupled with an adaptive two-dimensional positional encoding matrix. Add them together to form the input sequence. The formula is: .

[0023] Due to embedded tables and The parameters are optimized during training with the goal of minimizing the final positioning error. This mechanism enables the location encoding to autonomously learn a coordinate system that best fits the physical structure of the SCM from the data, thus preserving its spatial topology information more accurately than fixed encoding.

[0024] Subsequently, the feature sequence is flattened and positionally encoded. The input sequence is fed into a single-layer Transformer encoder, which has an embedding dimension of 512 and contains 16 attention heads. In the self-attention layer, the input sequence (for the first layer, this is...) is... ) are linearly projected into queries respectively ,key Sum The formula for a triplet is: ; In the formula, It is a learnable projection matrix.

[0025] The core multi-head self-attention mechanism will query ,key Sum Segmented into multiple heads ( Each head focuses on a different representational subspace of the input sequence, while capturing rich dependencies in parallel. For the first... indivual The calculation process is as follows: ; The outputs of all heads are concatenated and then subjected to another linear transformation to form the final output of this layer, as shown in the formula: ; After passing through this encoder layer, the network can compute the relationships between all feature locations, establishing a global context awareness. Finally, the Transformer module outputs a feature sequence containing global information. .

[0026] Dynamic Large Kernel Spatial Attention Module (D-LKA), based on output features Capture the spatial patterns and subtle features of the array during localization to obtain feature maps. Specifically: D-LKA first simulates a large receptive field through a series of depthwise separable convolutions and dilated convolutions, and then dynamically generates a spatial attention map. The formula is: ; In the formula, This represents depthwise separable convolution. Indicates dilated convolution; Then, Based on spatial attention graph Dynamic enhancement is achieved, and the final refined feature map is output. The formula is: .

[0027] D-LKA sharpens and enhances the local interferometric patterns that are most sensitive to distance and depth.

[0028] Prediction module, based on feature maps A multi-task learning framework is employed to estimate the distance and depth of the sound source. Specifically: Feature map After global average pooling, the data is fed into two parallel regression heads to predict distances. and depth .

[0029] The prediction module uses a loss function based on uncertainty weighting, the formula of which is: ; In the formula, and It is a learnable parameter that characterizes the uncertainty of the task. The network represents the distance to the sound source. Represents the actual distance to the sound source. The network predicts the depth of the sound source. Represents the depth of the actual sound source.

[0030] This invention also provides an underwater sound source localization method based on CNN-Transformer and dual attention mechanism, the steps of which include: S1. Preprocess the frequency domain sound pressure data received by the hydrophone to obtain the underwater sound source spatial covariance matrix tensor. For example... Figure 2 As shown, the preprocessing process includes: For each frequency Construct its corresponding complex sound pressure vector ,in, Indicates the number of hydrophones. Indicates the number of discrete frequency points; S12, Calculate the frequency at this frequency dimensional space covariance matrix The formula is: ; In the formula, This indicates the conjugate transpose. For the expected operation, It is a Hermitian matrix whose elements The first one was precisely encoded The and the first A hydrophone receives a signal at a frequency Cross-correlation on; S13, convert each complex covariance matrix Decomposed into its real part matrix and imaginary part matrix The real and imaginary matrices of all frequencies are stacked to form a multi-channel real feature map. The stacking formula is as follows: ; S14. Perform Z-Score standardization on the feature map to make its mean 0 and standard deviation 1, thus obtaining the underwater sound source spatial covariance matrix tensor. .

[0031] ; In the formula, and They are The mean and standard deviation, It is a small constant that prevents division by zero.

[0032] S2. Construct an underwater sound source localization model based on CNN-Transformer and dual attention mechanism; S3. Based on the underwater sound source spatial covariance matrix tensor, train the model constructed in step S2 to predict the distance and depth of underwater sound sources.

[0033] The training process includes: Input the underwater sound source spatial covariance matrix tensor into the model construction. First, the feature extraction module extracts local features from the spatial covariance matrix tensor of the underwater sound source to obtain an abstract feature map. ; Subsequently, the pixel-level channel attention module is based on the abstract feature map. The extracted local feature channels are recalibrated to obtain recalibrated features. ; Subsequently, the Transformer modeling module is based on the recalibrated features Adaptive two-dimensional positional encoding is introduced into the Transformer encoder. The Transformer encoder is used to serialize features, capture global context information, and obtain output features. ; Then, the dynamic large-kernel spatial attention module is based on the output features. Capture the spatial patterns and subtle features of the array during localization to obtain feature maps. ; Finally, the prediction module is based on feature maps. A multi-task learning framework is used to estimate the distance and depth of the sound source.

[0034] Example 1 To verify the performance of the model of this invention, a comparative experiment was conducted based on simulation data and the SWellEx-96 sea trial dataset, and the model was evaluated using mean absolute error (MAE) and accuracy (PCL).

[0035] Mean Absolute Error (MAE) is the average of the absolute errors between predicted and actual values. It directly reflects the model's prediction error; a smaller MAE value indicates higher model accuracy. The formula for calculating MAE is: ; In the formula, For the sample size, For the first The true value of each sample No. The model prediction value for each sample.

[0036] PCL (Probability of Correction) is a metric that evaluates the accuracy of predictions within a specified error range; a higher PCL value indicates better model performance. Specifically, a prediction is considered correct when the relative error between the predicted and actual values ​​is less than a set threshold. The formula for calculating PCL is: ; In the formula, This is an indicator function; it takes the value 1 when the condition is true, and 0 otherwise. and The first The true value and predicted value of each sample; The total number of samples, This represents the error tolerance. The simulation dataset uses a distance of 300m (…). =0.01), depth 5m ( =0.08) represents the error tolerance. The sea trial dataset uses a distance of 180m ( =0.06), depth 5m ( =0.08) indicates the error tolerance.

[0037] Simulation data: Based on the Kraken normal mode acoustic field calculation model, a multi-frequency simulation dataset with environmental parameter perturbations was constructed. The simulation environment was set as a typical shallow sea waveguide, and the water sound velocity was represented by a measured summer negative gradient profile. Figure 3 As shown, the receiver is a 7-element vertical linear array (VLA), deployed underwater at depths of 10m to 70m, with an element spacing of 10m. The sound source frequency range covers 50Hz to 200Hz, with a step size of 1Hz, totaling 151 frequency points. The dataset was divided into independent training and test sets to evaluate the model's learning performance and generalization ability.

[0038] In constructing the training set, a baseline marine environment was set: a seawater depth of 70m, a bottom longitudinal wave velocity of 1550m / s, and a density of 1.5g / cm³. 3 The attenuation was 0.05 dB / λ. Under this fixed environment, the sound source locations were uniformly and discretely sampled within a range of 1 km to 20 km (191 points) and a depth of 10 m to 60 m (6 points). The test set was designed to simulate a more challenging "environment mismatch" scenario. All test data were supplemented with Gaussian white noise with a signal-to-noise ratio (SNR) of 10 dB. The sampling points at the sound source locations were intentionally set to not overlap with the training set. These simulation data corresponding to a single mismatch type together constituted the final test set to rigorously test the model's generalization ability.

[0039] The simulation environment parameters are configured as shown in Table 1.

[0040] Table 1 Simulation Parameter Configuration

[0041] Based on simulation data, the model of this invention (MATS-Net) was compared with that of MTL-UNet, MTL-UNet-CBAM, Cnn-Trans, and Xception. The convergence curves of each model are shown in the figure. Figure 4 As shown.

[0042] The final positioning error and reliability analysis is as follows: Figure 5 , Figure 6 As shown in Table 2, MATS-Net achieved the best performance among all models, with distance and depth MAE reaching 0.152 km and 3.15 m, respectively. Crucially, its PCL metrics reached 98% and 96% on depth and distance tasks, respectively, indicating that MATS-Net not only predicts more accurately but also has the highest reliability. As a pure CNN architecture, Xception showed a significant weakness in distance estimation (MAE 0.242 km), and its depth estimation performance was also poor (MAE 6.10 m). The MTL-UNet model exposed the trade-offs of its U-shaped encoder-decoder structure in multi-task learning, resulting in the worst depth estimation performance. The Cnn-Trans model, as the strongest competitor, had performance (distance MAE 0.175 km, depth MAE 4.32 m) that was relatively close, but still significantly lower than MATS-Net.

[0043] Table 2 Performance of different models on simulated datasets

[0044] SWellEx-96 sea trial dataset: The location of the hydrophone and the sound source is as follows Figure 7 As shown. This event involved two sound sources at different depths: a shallow source at approximately 9 meters and a deep source at approximately 54 meters. The seabed structure in the experimental area is typically represented in acoustic modeling as a three-layered medium: an upper sedimentary layer, a lower mudstone layer, and a bottom semi-spatial substrate, as shown... Figure 8 As shown, the water depth was 216.5 m, and 21 vertical linear arrays (VLAs) were arranged at a distance of 5.6 m at depths ranging from 94 m to 212 m. The deep source transmitted signals with frequencies between 49 Hz and 400 Hz. The shallow source transmitted nine acoustic signals with frequencies between 109 Hz and 385 Hz. In this experiment, frequencies {49 64 79 94 112 130 148 166 201 235 283 338 388} were selected as the signal frequencies for the deep source, and frequencies {109 127 145 163 198 232 280 335 385} were selected as the signal frequencies for the shallow source.

[0045] In terms of dataset partitioning, 40-60 minutes of data were used for training, while 61-75 minutes of data were used for testing. This strategy aims to simulate a realistic forward prediction scenario: training the model using historical data and evaluating its generalization ability to future unknown events. Due to the time-varying nature of the marine environment, there is a gradual drift in the acoustic field features between the test and training sets. The model must be able to adapt to these feature changes caused by the dynamic evolution of the environment.

[0046] Based on the SWellEx-96 sea trial data, the model of this invention (MATS-Net) was compared with MFP, MTL-UNet, MTL-UNet-CBAM, Cnn-Trans, and Xception.

[0047] The model is evaluated using mean absolute error (MAE) and accuracy (PCL).

[0048] Its quantitative performance indicators are shown in Table 3, and the scatter plot of the specific positioning results is shown in Table 3. Figure 9 Experimental results clearly demonstrate that the proposed MATS-Net achieves state-of-the-art performance across all evaluation dimensions. Its distance and depth prediction MAEs are as low as 0.158 km and 2.84 m, respectively, while its PCL reaches 86% and 97% for depth and distance tasks, respectively, with a 5% error margin. Figure 9 As shown in (f) and 9(i), the predicted points of MATS-Net closely follow the distribution of the true values, exhibiting extremely low dispersion, intuitively verifying its superior localization accuracy and stability. In contrast, as a representative of traditional physical models, MFP performs the worst due to its inherent environment mismatch problem (distance MAE 0.375 km, depth MAE 5.60 m). Among deep learning models, Xception, with its pure CNN architecture, achieves acceptable depth estimation (MAE 3.85 m), but its distance estimation error is relatively large (MAE 0.242 km). Figure 9 (b) It can be seen that the distance prediction points are relatively divergent. Although MTL-UNet-CBAM outperforms the original MTL-UNet on the distance task by introducing an attention mechanism, both perform poorly on more refined depth estimation (4.32 m and 4.19 m, respectively). The CNN-Trans model achieves some performance improvement by applying the Transformer, but its MAE (distance 0.168 km, depth 4.35 m) and PCL index still lag significantly behind MATS-Net.

[0049] Table 3 Performance of different models on real datasets

[0050] Example 2 To verify the robustness of the model in dealing with frequency-selective fading in underwater acoustic channels, multi-frequency joint processing experiments were conducted. Due to multipath effects, a single-frequency signal may be located at a deep fading point in the channel, while frequency diversity provided by multi-frequency information can effectively circumvent this problem. Even if some frequency information is lost, the model can still extract robust localization features from other effective frequency points. Comparative experiments were conducted using combinations of 1, 3, 5, and 8 frequencies, respectively. The frequencies selected for deep-source targets are {49}, {49,148,283}, {49,94,148,201,283}, and {49,94,148,201,283,338,347,397}; the frequencies selected for shallow-source targets are {109}, {109,163,232}, {109,127,163,232,335}, and {109,127,145,163,198,232,280,335}, to evaluate the noise immunity performance of underwater acoustic localization under different bandwidth conditions. The impact of the number of frequency points on performance is as follows: Figure 10 As shown in Table 4, the results of the multi-frequency experiments indicate that as the number of input frequency points increased from 1 to 8, the MAE for distance prediction decreased from 0.408 km to 0.158 km, while the MAE for depth prediction improved from 6.41 m to 2.84 m. Simultaneously, with an error tolerance of 0.25 km depth and 5 m distance, the PCL for depth increased from 87% to 97%, and the accuracy of distance prediction rose from 74% to 86%. These results demonstrate that fusing richer frequency domain information can effectively enhance the model's ability to represent the complex propagation characteristics of sound fields, thereby improving positioning accuracy and robustness.

[0051] Table 4 Results of Multi-Frequency Experiment

[0052] In Transformer encoders, the number of heads in the multi-head self-attention mechanism is a key hyperparameter. A higher head count allows the model to examine feature associations in more diverse ways, but excessive heads can also lead to parameter redundancy and overfitting. Therefore, to explore its optimal configuration, a series of comparative experiments were conducted, setting the head count to 2, 4, 8, 16, and 32. The experimental results reveal a clear performance evolution trend. Figure 11As shown, the model's performance significantly and continuously improved as the number of attention heads increased from 2 to 16. The MAE for distance prediction decreased dramatically from 0.432 km to 0.158 km, and the MAE for depth prediction also improved from 6.83 m to 2.84 m. This indicates that more heads mean the model can simultaneously focus on more different types of feature associations, making the model's understanding of the sound field structure more comprehensive and robust. However, this performance gain is not unlimited. When the number of heads further increased from 16 to 32, the MAE for both distance and depth slightly rebounded. This phenomenon suggests that there is an optimal balance point in the selection of the number of attention heads. Too many heads dilute the representation dimension of each head, which may make it difficult for a single head to learn sufficiently rich semantic information, and also increases the risk of model overfitting.

[0053] Example 3 To systematically quantify the contribution of each module in this model, ablation experiments were conducted, and the results are shown in Table 5. The experiments clearly reveal the independent value of each module and the indispensable synergistic enhancement effect among them. Figure 12 and 13 As shown, Figure 12 In the figure, (a) and (f) represent the baseline; (b) and (g) represent the baseline + Trans; (c) and (h) represent the baseline + Trans + PPA; (d) and (i) represent the baseline + Trans + D-LKA; and (e) and (j) represent the complete model. As shown in the figure, the baseline model with only the ResNet backbone performs poorly, exposing the limitations of relying solely on local feature extraction. After introducing the Transformer module, the performance is significantly improved, with the MAE decreasing to 0.432 km and 6.47 m, strongly validating the crucial role of global context modeling in capturing long-range dependencies of the sound field. Based on this, integrating the PPA module to enhance channel features and integrating the D-LKA module to refine spatial details both bring clear performance gains. The complete MATS-Net model integrating all modules achieves overwhelmingly optimal performance, with its distance and depth MAE significantly reduced to 0.158 km and 2.84 m, respectively. This significant performance leap, representing approximately 50% improvement over the strongest single-attention model, fully demonstrates that this model achieves a major breakthrough in positioning accuracy and robustness in complex marine environments through the synergistic enhancement of its various modules: Transformer constructs global perception, PPA performs filtering in the channel dimension, and D-LKA refines in the spatial dimension.

[0054] Table 5. Ablation Experiment Results

[0055] Therefore, this invention adopts the above-mentioned underwater sound source localization model and method based on CNN-Transformer and dual attention mechanism. Through the synergistic effect of the dual attention mechanism, it jointly suppresses spectral diffusion interference and feature degradation effect, providing a new solution for achieving high-precision sound source localization in complex marine environments.

[0056] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. An underwater sound source positioning model based on a CNN-Transformer and a double attention mechanism, characterized in that: The model comprises a feature extraction module, a pixel-level channel attention module, a Transformer modeling module, a dynamic kernel space attention module and a prediction module. The feature extraction module extracts local features of the underwater sound source spatial covariance matrix tensor to obtain an abstract feature map ; The pixel-level channel attention module is based on an abstract feature map Rescale the extracted local feature channels to obtain rescaled features ; The Transformer modeling module is based on the recalibrated features In the Transformer encoder, adaptive two-dimensional position coding is introduced, the feature sequence is serialized using the Transformer encoder, global context information is captured, and output features are obtained ; The dynamic large kernel space attention module is based on output features , captures array spatial patterns and subtle features in positioning, and obtains a feature map ; The prediction module is configured to estimate the distance and depth of the sound source based on the feature map. , a multi-task learning framework is adopted to estimate the distance and depth of the sound source.

2. The underwater sound source positioning model based on CNN-Transformer and double attention mechanism according to claim 1, wherein, The obtained abstract feature map Comprise: using a ResNet-based CNN backbone to extract features, extract the basic acoustic features in the underwater sound source spatial covariance matrix tensor, and combine them into higher-order abstract feature maps .

3. The underwater sound source positioning model based on CNN-Transformer and double attention mechanism according to claim 1, wherein: the obtained re-targeted features comprising: Firstly, the two-dimensional spatial information of each channel is compressed into a scalar descriptor by global average pooling The formula is: ; In the formula, respectively the number of channels, height and width of the feature map, denotes a two-dimensional spatial position; Then, the scalar descriptor passes through two serial convolution layers to learn the nonlinear dependence between channels and generate a normalized channel weight vector The formula is: ; wherein is a GELU activation function, is a Sigmoid activation function; Channel weight vector acting on the abstract feature map in a channel-wise multiplication manner , obtaining a re-labeled feature , the formula is: 。 4. The underwater sound source positioning model based on CNN-Transformer and double attention mechanism according to claim 1, wherein, The output feature is obtained comprising: Introducing adaptive two-dimensional position coding to convert two-dimensional spatial position Decompose and index into rows and column indexes Create learnable nested tables separately. and any position Position encoding It is generated by adding the learned row and column embedding vectors, and the formula is: ; feature map is flattened into a sequence of features and added to an adaptive two-dimensional position encoding matrix to form an input sequence , which is given by ; Flattened and position-encoded feature sequences are fed into a single-layer Transformer encoder, in which the input sequence is linearly projected into query , key , and value triplets separately in a self-attention layer. A multi-head self-attention mechanism splits the query , key , and value into different representations subspaces, each of which is attended to by a different head. The outputs of all heads are concatenated and passed through a linear transformation again to form the final output features of this layer .

5. The underwater sound source positioning model based on CNN-Transformer and double attention mechanism according to claim 1, wherein, The obtained feature map comprises: First, a series of depthwise separable convolution and atrous convolution are used to simulate large receptive field and dynamically generate spatial attention map The formula is: ; wherein denotes a depthwise separable convolution, denotes a atrous convolution; Then, based on the spatial attention map to realize dynamic enhancement, and finally output the refined feature map , the formula is: 。 6. The underwater sound source positioning model based on CNN-Transformer and double attention mechanism according to claim 1, wherein, The prediction module specifically includes: a feature map After global average pooling, it is sent into two parallel regression heads to predict the distance and the depth .

7. The underwater sound source positioning model based on CNN-Transformer and double attention mechanism according to claim 1, wherein, The prediction module adopts a loss function based on uncertainty weighting, and the formula is: ; wherein and are learnable parameters characterizing the task uncertainty, denotes the network predicted sound source distance, denotes the real sound source distance, denotes the network predicted sound source depth, denotes the real sound source depth.

8. An underwater sound source positioning method based on a CNN-Transformer and a double attention mechanism, characterized by the steps of It comprises: S1, pre-processing the frequency domain sound pressure data received by the hydrophone to obtain an underwater sound source spatial covariance matrix tensor; S2, constructing an underwater sound source positioning model based on CNN-Transformer and double attention mechanism as claimed in any one of claims 1-7; S3, based on the underwater sound source spatial covariance matrix tensor, training the model constructed in step S2 to predict the distance and depth of the underwater sound source.

9. The underwater sound source positioning method based on CNN-Transformer and double attention mechanism according to claim 8, characterized in that: The pre-processing of the frequency domain sound pressure data received by the hydrophone in S1 comprises: S11, for each frequency constructing its corresponding complex pressure vector wherein, denotes the number of hydrophones, denotes the number of discrete frequency points; S12, calculate the frequency under dimensional space covariance matrix , the formula is: ; In the formula, This indicates the conjugate transpose. For the expected operation, It is a Hermitian matrix whose elements The first one was precisely encoded The and the first A hydrophone receives a signal at a frequency Cross-correlation on; S13, decompose each complex covariance matrix into its real matrix and imaginary matrix and stack the real and imaginary matrices of all frequencies to form a real-valued feature map of multiple channels; S14, normalizing the feature map to obtain an underwater sound source spatial covariance matrix tensor .

10. The underwater sound source positioning method based on CNN-Transformer and double attention mechanism according to claim 9, characterized in that, The stacking formula is: 。