Sonar image underwater detection method and system based on multi-scale feature fusion and efficient up-sampling algorithm

By improving the YOLO network through multi-scale feature fusion and efficient upsampling algorithms, the problems of single detector head scale and loss of small target features during upsampling in underwater target detection are solved, achieving high-precision and real-time detection of underwater targets.

CN119832406BActive Publication Date: 2025-12-09NANJING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411892309.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-12-09
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

Existing YOLO networks suffer from problems in underwater target detection, such as a single detection head scale and the easy loss of small target feature information during upsampling, resulting in poor detection performance.

Method used

We employ multi-scale feature fusion and efficient upsampling algorithms. By constructing an efficient upsampling module and a multi-scale feature fusion module, and combining channel attention and spatial attention mechanisms, we improve the upsampling process. Furthermore, we introduce a dynamic detection head into the YOLOv11 network to enhance the detection performance for small targets.

Benefits of technology

It improves the accuracy and robustness of underwater target detection, effectively detects fast-moving and small targets, reduces errors caused by scale changes, and enhances the real-time performance and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832406B_ABST
    Figure CN119832406B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on multi-scale feature fusion and high school upsampling algorithm's underwater detection method and system of sonar image, the method includes: collecting underwater typical target forward-looking sonar data, and the detection training and test data set of sonar image are made to obtain;Build the feature fusion network including efficient upsampling module, multi-scale feature fusion module and small target detection branch, build the target detection algorithm model based on YOLOv11, the neck network of YOLOv11 is regarded as feature fusion network, and the deep feature map detection branch of YOLOv11 is removed;The data set made is used to train target detection algorithm model, and forward-looking sonar image is input into the model trained and inquired, to obtain the detection result of underwater typical target.The application improves the accuracy and robustness of underwater target detection algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of underwater target detection of sonar images, and particularly relates to a sonar image underwater detection method and system based on multi-scale feature fusion and high upsampling algorithm. BACKGROUND

[0002] The underwater target detection method is not only an important tool for monitoring and tracking submarines and underwater unmanned systems, but also an effective way for aquatic organism detection and submarine pipeline detection. Due to the limitations of underwater environment and acoustic detection physical characteristics, sonar imaging has the shortcomings of noise sensitivity, limited resolution and imaging instability, which leads to poor detection and tracking effect of the target. Therefore, the underwater target detection technology is becoming an important research direction, and the technology has great significance for strengthening marine defense and marine resource management.

[0003] In recent years, the related research of underwater target detection technology is basically concentrated in deep learning, and the exploration and research of convolutional neural network develop rapidly. Although the underwater target detection task has some special challenges such as light attenuation and water flow interference, the characteristics of YOLO network make it have the potential to become an effective tool to solve these problems. However, the detection head scale of YOLO network is single, and only static feature maps can be input, so the prediction result cannot be corrected in time during underwater target detection. A large amount of small target feature information is easily lost in the upsampling process of YOLO network. Under this background, it is necessary to carry out research on underwater detection method based on YOLO network. SUMMARY

[0004] The purpose of the present application is to provide a sonar image underwater detection method and system based on multi-scale feature fusion and high upsampling algorithm, which overcomes the problems of scale transformation, small target and low resolution of the target to be detected in water environment.

[0005] The technical solution for achieving the purpose of the present application is:

[0006] A sonar image underwater detection method based on multi-scale feature fusion and high upsampling algorithm, comprising the steps of:

[0007] S1, collecting typical underwater target forward-looking sonar data, extracting and converting the sonar metadata, obtaining sonar images frame by frame, arranging and labeling the data set, and making detection training and test data set of sonar images;

[0008] S2, constructing a high-efficiency upsampling module, and improving the upsampling process based on a compensation mechanism;

[0009] S3, constructing a multi-scale feature fusion module to strengthen multi-scale feature information fusion;

[0010] S4, construct a feature fusion network comprising an efficient up-sampling module, a multi-scale feature fusion module and a small target detection branch;

[0011] S5, construct a target detection algorithm model based on YOLOv11, use the feature fusion network as the neck network of YOLOv11, and remove the deep feature map detection branch of YOLOv11; when the target detection algorithm model performs image processing, input the feature map to the backbone network of the target detection algorithm model for feature extraction and input to the feature fusion network; the shallow feature maps of the backbone network and the feature fusion network are sequentially down-sampled by down-sampling, the feature fusion network simultaneously uses the efficient up-sampling module to up-sample the deep feature maps, uses the multi-scale feature fusion module to perform bidirectional feature fusion with the feature maps of the next layer of the same scale, and adopts the small target detection branch to strengthen the detection effect of small targets;

[0012] S6, use the prepared data set to train the target detection algorithm model, input the forward-looking sonar image into the trained model for inference, and obtain the detection result of the underwater typical target.

[0013] Further, the step S1 specifically comprises:

[0014] S1.1, collecting underwater sonar data of typical targets by using a forward-looking sonar;

[0015] S1.2, extracting and converting the sonar data to coordinate axes, obtaining sonar images frame by frame, scaling all sonar images to a resolution of 1280*720 pixels, and labeling according to requirements to prepare a data set;

[0016] S1.3, performing mask extraction on the sonar images to obtain a mask annotation set, which is used as a basis for learning mask refinement in the target detection algorithm model training process.

[0017] Further, the typical targets include conical targets, net-shaped targets and irregular targets.

[0018] Further, the process of the efficient up-sampling module for image processing comprises:

[0019] using multi-scale convolution to down-sample the input image, which is:

[0020]

[0021] wherein F down represents the feature map output by down-sampling, W i represents the convolution kernel weight of different scales, F in,j is the input feature map, N is the number of different scales, and * represents convolution operation;

[0022] The down-sampling feature map is processed by the channel attention CAB and the spatial attention SAB mechanism, and the processed feature map is expressed as:

[0023] F CAB =σ(W2·ReLU(W1·GAP(X))

[0024] F SAB =σ(Conv 7×7 (X))

[0025] In the formula, F CAB represents the weight of the channel attention, GAP represents the global average pooling of each channel, W1 and W2 are the weight matrices of two fully connected layers, X is the input feature map, ReLU represents the activation function ReLU, and σ represents the Sigmoid function, which is used to map the channel weight to the interval (0, 1); F SAB represents the weight of the spatial attention, X is the input feature map, and σ represents the Sigmoid function, Conv 7×7 represents a large kernel convolution.

[0026] The image enhanced by the channel attention CAB and the spatial attention SAB mechanism is restored to a higher resolution through an up-sampling operation, and is fused with the feature map from the skip connection through element-wise addition, and the fused feature map is expressed as:

[0027] X‘=X+CompKernel(X)

[0028] Y upsample =Upsample(X)

[0029] In the formula, X is the input down-sampling feature map, CompKernel(X) represents the correction of the compensation kernel to the feature map, Y upsample represents the output image after up-sampling, and Upsample(X) represents the up-sampling operation on the input X.

[0030] When the skip connection is combined with the large convolution kernel grouping attention door module, the feature map after the up-sampling of the feature map fused with the skip connection feature is transmitted to the large convolution kernel grouping attention door module, and the final output feature map is obtained, which is expressed as:

[0031] F EUCB =F fused ×F CAB ×F SAB

[0032] In the formula, F fused is the feature map fused by the skip connection and the up-sampling, and F EUCB is the output feature.

[0033] Further, the feature map is input to the backbone network of the target detection algorithm model for feature extraction, specifically including:

[0034] The feature map is down-sampled four times in the backbone network part. After the first down-sampling, it is connected to the feature fusion network through a convolution with a step of 2 and a channel number of 256 for down-sampling again. The feature maps after other down-samplings are connected to the feature fusion network through a convolution with a step of 1 and a channel number of 256. The channel number of each layer of feature map is fixed to 256, the input picture is adjusted to a fixed size, and normalized, which is:

[0035]

[0036] In the formula, I is the original input image, normalized to the interval [0, 1];

[0037] Then, the YOLOv11 feature extraction backbone network Backbone is used. The feature extraction backbone network Backbone is composed of a convolution with a step of 2, a C3K2, a fast spatial pyramid pooling module, and a point aggregation attention module. First, the image is feature segmented, which is:

[0038] F1, F2 = Split(F)

[0039] In the formula, F1, F2 are different feature maps input, and Split(F) represents feature segmentation of the feature map;

[0040] Then, 2 Bottleneck blocks are applied to F2, which is:

[0041] F2' = Bottleneck2(Bottleneck1(F2))

[0042] In the formula, Bottleneck represents feature extraction stacking of the feature map;

[0043] Then, the feature is spliced, and F1 and F2' are spliced in the channel dimension:

[0044] F cat = Concat(F1, F2')

[0045] Finally, the features are fused, and a 1x1 convolution is used to fuse the channel features to obtain the final output, and the calculation formula is as follows:

[0046] F out = Conv 1x1 (F1, F'2)

[0047] The fast spatial pyramid pooling module extracts multi-scale features using different scale maximum pooling operations, and fuses these features through splicing and convolution to obtain:

[0048] F1 = MaxPool(F, k = 5, s = 1, padding = 2)

[0049] F2 = MaxPool(F1, k = 5, s = 1, padding = 2)

[0050] F3 = MaxPool(F2, k = 5, s = 1, padding = 2)

[0051] In the formula: the fast spatial pyramid pooling module adopts 3 times of maximum pooling operation, k = 5 represents that the kernel size of the pooling is 5, s = 1 represents that the step length is 1, and padding = 2 represents that the convolution edge filling coefficient is 2;

[0052] The pooled feature maps F1, F2, F3 are spliced in the channel dimension:

[0053] F cat = Concat(F, F1, F2, F3)

[0054] Finally, through a 1x1 convolution layer, the channel number is reduced and the spliced features are fused:

[0055] F out = Conv 1x1 (F cat )

[0056] The point aggregation attention module of YOLOv11 performs feature segmentation through the C2 feature module, and inserts a point aggregation parallel spatial attention module in the middle. The input feature F is divided into F1 and F2 in the channel dimension. F1 is convolved to extract local features. F2 passes through a parallel spatial attention module to generate a set of attention weights and reweights the input features. The relevant calculation formula is as follows:

[0057] F1, F2 = Split(F)

[0058] F′1 = Conv 3×3 (F1)

[0059] F ca = σ(MLP(GAP(F2)))

[0060] F sa = σ(Conv k×k (Concat(AvgPool(F2), MaxPool(F2))))

[0061] F psa = F2·F ca ·F sa

[0062] MLP is a multi-layer perceptron network, σ represents a Sigmoid function, GAP represents global average pooling, AvgPool represents average pooling, MaxPool represents maximum pooling, F ca represents channel attention, F sa represents spatial attention.

[0063] Further, the multi-scale feature fusion module strengthens the process of multi-scale feature information fusion, which is:

[0064] By initializing the weights of the input multiple feature maps and performing weight fusion, using the ReLU function for activation, then performing weight normalization, and finally weighting the sum of the weights to obtain the final fused feature map; the weighted sum formula is:

[0065]

[0066] P fused is the output weight after fusion, is the normalized weight, and

[0067]

[0068] ReLU is an activation function, and ε is a constant.

[0069] Further, the feature fusion network includes the following steps in the process of processing the image: down-sampling by a convolution with a step of 2 and performing feature fusion with adjacent deep feature maps through a multi-scale feature fusion module, up-sampling the deep feature maps through a high-level up-sampling module and connecting to the multi-scale feature fusion module to perform feature fusion with adjacent shallow feature maps of the previous layer, to obtain:

[0070] P i = P fused (Conv(P i-1 ))+P fused (F EUCB (P i+1 ))

[0071] P i represents the current layer feature map, P i-1 represents the adjacent shallow feature map, P i+1 represents the adjacent deep feature map; P fused (Conv(P i-1 )) represents down-sampling the feature map of the previous layer and connecting to the multi-scale feature fusion module, P fused (F EUCB (P i+1) represents efficient up-sampling of the next layer feature map and connection to the multi-scale feature fusion module.

[0072] Further, the detection algorithm model adopts a dynamic detection head to output an image recognition result.

[0073] Further, the dynamic detection head outputs the image recognition result specifically includes:

[0074] The dynamic detection head includes three dimensions of scale perception, spatial perception and task perception, and the three dimensions are respectively generated by a channel attention and a spatial attention to generate feature weights through a channel and a spatial dimension, and the calculation formula is:

[0075]

[0076]

[0077] In the formula: GAP (F l ) represents global average pooling, W ca and b ca represent the weight and bias of the channel attention;

[0078] Then, a task attention module is used to model the dynamic feature respectively for classification tasks and regression tasks, and the formula is:

[0079]

[0080] In the formula: W cls , b cls represent the weight and bias of the classification task, W reg , b reg represent the weight and bias of the regression task;

[0081] Then, the outputs of the classification task and the regression task branch are obtained:

[0082]

[0083] In the formula: W cls_out , b cls_out represent the linear transformation parameters of the classification branch, W reg_out , b reg_out represent the linear transformation parameters of the regression branch.

[0084] A sonar image underwater detection system based on a multi-scale feature fusion and high school up-sampling algorithm, comprising:

[0085] A data set generation unit collects forward-looking sonar data of typical underwater targets, extracts sonar metadata and converts coordinate axes, obtains sonar images frame by frame, arranges and labels the data set, and produces detection training and test data sets of sonar images;

[0086] A target detection algorithm model construction unit constructs a feature fusion network including an efficient up-sampling module, a multi-scale feature fusion module and a small target detection branch, constructs a target detection algorithm model based on YOLOv11, uses the feature fusion network as the neck network of YOLOv11, and removes the deep feature map detection branch of YOLOv11; when the target detection algorithm model performs image processing, the feature map is input to the backbone network of the target detection algorithm model for feature extraction and input to the feature fusion network; the shallow feature maps of the backbone network and the feature fusion network are sequentially down-sampled by down-sampling, the feature fusion network simultaneously up-samples the deep feature maps using the efficient up-sampling module, performs bidirectional feature fusion with the same scale feature maps of the next layer using the multi-scale feature fusion module, and adopts the small target detection branch to enhance the detection effect of small targets;

[0087] A target detection unit trains the target detection algorithm model using the produced data set, inputs the forward-looking sonar image into the trained model for inference, and obtains the detection result of the typical underwater target.

[0088] Compared with the prior art, the present application has the following advantages:

[0089] 1. The present application uses YOLOv11 network as the basic framework of the underwater target detection method, which combines image enhancement and real-time detection technology, and can effectively reduce the error caused by the rotation of underwater target objects.

[0090] 2. The up-sampling process of the original YOLO network easily loses a large amount of small target feature information, and the present application constructs an efficient up-sampling module, improves the traditional down-sampling-enhancement-up-sampling process through a compensation-based mechanism to improve the accuracy and efficiency of image reconstruction, and enhances the detection of small targets.

[0091] 3. The present application considers the influence of scale transformation of underwater target objects, sequentially down-samples the shallow feature maps of the backbone network and the feature fusion network, simultaneously up-samples the deep feature maps using the efficient up-sampling module, performs bidirectional feature fusion with the same scale feature maps of the next layer using the multi-scale feature fusion module, adds a small target detection branch and removes the deep feature map detection branch; the entire feature fusion network structure fuses the feature information of the deep feature maps and the shallow feature maps with each other, thereby effectively improving the detection accuracy.

[0092] 4. The original YOLO network detection head scale is single, only static feature map can be input, and the prediction result cannot be corrected in time when underwater target detection is carried out, the dynamic detection head is adopted, feature information is fused from three dimensions of scale, space and task, a dynamic weighting mechanism is introduced, feature representation of each position can be adaptively adjusted according to context information, and the detection effect is strengthened. BRIEF DESCRIPTION OF DRAWINGS

[0093] Figure 1 The algorithm flowchart of the present application.

[0094] Figure 2 The algorithm structure diagram of the present application.

[0095] Figure 3 The high school upsampling structure diagram of the present application.

[0096] Figure 4 The multi-scale feature fusion structure diagram of the present application

[0097] Figure 5 The feature fusion network feature map flow structure diagram of the present application.

[0098] Figure 6 The dynamic detection head structure diagram of the present application.

[0099] Figure 7 The underwater fishing net target sonar detection diagram of the embodiment of the present application.

[0100] Figure 8 The underwater fishing net target detection result diagram of the embodiment of the present application.

[0101] Figure 9 The unmanned underwater vehicle sonar detection diagram of the embodiment of the present application.

[0102] Figure 10 The unmanned underwater vehicle tracking result diagram of the embodiment of the present application. DETAILED DESCRIPTION

[0103] The present application will be further described in detail below in combination with the drawings and specific embodiments.

[0104] YOLOv11 is the latest version of YOLO series network, has higher detection precision and faster reasoning speed, the embodiment takes it as a benchmark model and improves and updates on the basis, in order to overcome the scale transformation of the target to be detected in water environment, the problem that the target is too small and the resolution is low, a sonar image underwater detection method based on multi-scale feature fusion and high school upsampling algorithm is proposed. Figure 1 As shown in the figure, the method implementation process includes the following steps:

[0105] S1, collect underwater typical target forward-looking sonar data, extract and coordinate axis conversion sonar data, frame by frame to obtain sonar image, data set collation and labeling, making sonar image tracking training and test data set;

[0106] S1.1, using forward-looking sonar to collect underwater sonar data of typical targets, the typical targets including cone-shaped targets, net-shaped targets, irregular targets, etc.;

[0107] S1.2, extracting and coordinate axis conversion sonar data, frame by frame to obtain sonar image, all sonar images are scaled to 1280*720 pixel resolution, and labeled according to requirements, making the data set special for the application;

[0108] S1.3, the sonar image is extracted to obtain a mask annotation set, which is used as the basis for learning mask refinement in the network training process.

[0109] S2, construct a target detection model framework based on YOLOv11, such as Figure 2 , the feature map is input into its backbone network for feature extraction and input into the feature fusion network;

[0110] S3, construct an efficient up-sampling module, improve the process of traditional up-sampling through a compensation-based mechanism;

[0111] In this step, an efficient up-sampling module is proposed, such as Figure 3 , starting from inputting a low-resolution image, the goal is to improve its resolution, then down-sampling the input image, using multi-scale convolution (DWC) calculation formula:

[0112]

[0113] In the formula: F down represents the down-sampling output feature map, W i represents the convolution kernel weight of different scales, F in,j is the input feature map, N is the number of different scales, and * represents the convolution operation. In order to extract important features in the image, prepare for subsequent enhancement processing.

[0114] Then through the channel attention CAB (Channel Attention Block) and spatial attention SAB (Spatial Attention Block) mechanism to fine processing of feature map, so as to better focus on key information. The CAB calculation formula is:

[0115] F CAB =σ(W2·ReLU(W1·GAP(X))

[0116] In the formula: FCAB The weight representing the channel attention, GAP (Global Average Pooling) represents the global average pooling for each channel, W1 and W2 are the weight matrices of two fully connected layers, X is the input feature map, ReLU represents the activation function ReLU, and sigma represents the Sigmoid function, which is used to map the channel weight to the interval (0, 1).

[0117] The SAB calculation formula is as follows:

[0118] F SAB = sigma (Conv 7×7 (X))

[0119] In the formula: F SAB represents the weight of spatial attention, X is the input feature map, sigma represents the Sigmoid function, and Conv 7×7 represents a large kernel convolution.

[0120] In this process, the compensation kernel estimation mechanism is involved to correct the information loss in the downsampling process. Then through the upsampling operation, the enhanced image is restored to a higher resolution, and it is fused with the feature map from the skip connection to enhance the feature details. The element-wise addition is adopted, and the calculation formula is as follows:

[0121] X' = X + CompKernel (X)

[0122] Y upsample = Upsample (X)

[0123] In the formula: X is the input downsampling feature map, CompKernel (X) represents the correction of the feature map by the compensation kernel, Y upsample represents the output image after upsampling, and Upsample (X) represents the upsampling operation on the input X.

[0124] The efficient upsampling module combines the feature map after upsampling with the output of the large convolution kernel grouping attention gate module to further improve the segmentation accuracy. When the skip connection is combined with the large convolution kernel grouping attention gate module, the feature map after the upsampling of the feature map fused with the skip connection feature is transmitted to the large convolution kernel grouping attention gate module, and the output feature map is finally obtained through the fine-grained enhancement of the attention mechanism mentioned above. The calculation formula is as follows:

[0125] F EUCB = F fused x F CAB x F SAB

[0126] In the formula: F fusedis the feature map after the jump connection and the up-sampling fusion, F EUCB is the output feature.

[0127] The whole process improves the accuracy of the feature by compensating for the estimation of the kernel, ensuring that the image details are fully restored in the up-sampling stage.

[0128] S4, a new multi-scale feature fusion module is proposed to strengthen the multi-scale feature information fusion;

[0129] In this step, a multi-scale feature fusion module is proposed, such as Figure 4 , by initializing the weights of the input multiple feature maps and performing weight fusion, using the ReLU function for activation, then performing weight normalization, and finally weighting the sum of the weights to obtain the final fused feature map. The weighted sum formula is:

[0130]

[0131] In the formula: P fused is the output weight after fusion, is the normalized weight, and its specific expression is as follows:

[0132]

[0133] In the formula: ReLU is the activation function, and ε is a very small constant to prevent division by zero error.

[0134] S5, a new feature fusion network is constructed, such as Figure 5 , the shallow feature maps of the backbone network and the feature fusion network are down-sampled one by one, while the deep feature maps are up-sampled using the high-level up-sampling module, the multi-scale feature fusion module is used for bidirectional feature fusion with the same scale feature map of the next layer, a small target detection branch is added and the deep feature map detection branch is removed;

[0135] The calculation formula of the constructed feature fusion network is as follows:

[0136] P i = P fused (Conv(P i-1 ))+ P fused (F EUCB (P i+1 ))

[0137] Where, P i represents the current layer feature map, P i-1 represents the adjacent shallow feature map, P i+1 represents the adjacent deep feature map. P fused (Conv(P i-1) represents that the feature map of the previous layer is down-sampled and connected to the multi-scale feature fusion module, P fused (F EUCB (P i+1 ) represents that the feature map of the next layer is efficiently up-sampled and connected to the multi-scale feature fusion module.

[0138] S6, a dynamic detection head is constructed, a small target detection head is added, and a large scale feature map detection head is removed to strengthen the detection effect.

[0139] As Figure 6 , the core of the dynamic detection head is the dynamic attention mechanism, which includes three dimensions of scale perception, spatial perception and task perception. The three dimensions are respectively generated by channel attention and spatial attention modules through channel and spatial dimensions to generate feature weights. The related calculation formula is as follows:

[0140]

[0141] In the formula: GAP(F l ) represents global average pooling, W ca and b ca represent the weight and bias of channel attention.

[0142] Then the task attention module dynamically models the dynamic features for classification and regression tasks respectively, and the related calculation formula is as follows:

[0143]

[0144] In the formula: W cls , b cls represent the weight and bias of the classification task. W reg , b reg represent the weight and bias of the regression task.

[0145] Then the outputs of the classification and regression branches are obtained:

[0146]

[0147] In the formula: W cls_out , b cls_out represent the linear transformation parameters of the classification branch. W reg_out , b reg_out represent the linear transformation parameters of the regression branch.

[0148] S7, the improved target detection model is trained by using the prepared data set, and the trained model is applied to typical target detection of sonar images. The front-looking sonar image is input into the trained model for inference to obtain the detection result of the underwater typical target.

[0149] The embodiment also provides a sonar image underwater detection system based on a multi-scale feature fusion and high-efficiency upsampling algorithm, comprising:

[0150] A data set generation unit collects forward-looking sonar data of underwater typical targets, extracts sonar metadata and performs coordinate axis conversion, obtains sonar images frame by frame, arranges and labels a data set, and prepares a detection training and test data set of sonar images;

[0151] A target detection algorithm model construction unit constructs a feature fusion network comprising an efficient upsampling module, a multi-scale feature fusion module and a small target detection branch, constructs a target detection algorithm model based on YOLOv11, uses the feature fusion network as a neck network of YOLOv11 and removes a deep feature map detection branch of YOLOv11; when the target detection algorithm model performs image processing, a feature map is input to a backbone network of the target detection algorithm model for feature extraction and input to the feature fusion network; the backbone network and the feature fusion network are sequentially downsampled by downsampling, the feature fusion network simultaneously uses the high-efficiency upsampling module to upsample a deep feature map, uses the multi-scale feature fusion module to perform bidirectional feature fusion with a feature map of the same size of a next layer, and adopts the small target detection branch to strengthen the detection effect on small targets;

[0152] A target detection unit trains the target detection algorithm model using the prepared data set, inputs a forward-looking sonar image into the trained model for inference, and obtains a detection result of underwater typical targets.

[0153] Taking remote detection of an underwater unmanned submarine in a self-made sonar data set as an embodiment, original pictures obtained by a M750d type forward-looking active sonar detection are as shown in Figure 7 and Figure 9 The combined pictures are images of the 1st, 66th, 134th frames and the 3rd, 27th and 53rd frames in sequence, the unmanned submarine moves in water at a relatively fast speed, and the imaging target is small due to a relatively long distance from the sonar; the detection result of the embodiment of the present application for remote detection of the unmanned submarine is as shown in Figure 8 and Figure 10 It can be seen that the present application also has good detection effect on fast moving and small targets.

[0154] The present application designs a new feature fusion network and a multi-scale feature fusion module, and designs an efficient upsampling module and a dynamic detection head to improve the YOLO network, solves the problems of poor effect on target size change, too small target and low resolution of the original network template, and improves the accuracy and robustness of the underwater target detection algorithm.

[0155] The above merely describes preferred specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art, according to the technical solution and inventive concept of the present application, makes equivalent replacement or change within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. An underwater detection method for sonar images based on multi-scale feature fusion and efficient up-sampling algorithm, characterized in that, The method comprises the steps of: S1, collecting forward-looking sonar data of typical underwater targets, extracting and converting sonar data, obtaining sonar images frame by frame, arranging and labeling data sets, and making detection training and test data sets of sonar images; S2, constructing an efficient up-sampling module, and improving the up-sampling process based on a compensation mechanism; S3, constructing a multi-scale feature fusion module to strengthen multi-scale feature information fusion; S4, constructing a feature fusion network including the efficient up-sampling module, the multi-scale feature fusion module and a small target detection branch; S5, constructing a target detection algorithm model based on YOLOv11, taking the feature fusion network as the neck network of YOLOv11, and removing the deep feature map detection branch of YOLOv11; when the target detection algorithm model performs image processing, the feature map is input to the backbone network of the target detection algorithm model for feature extraction and input to the feature fusion network; the shallow feature maps of the backbone network and the feature fusion network are sequentially down-sampled through down-sampling, the feature fusion network simultaneously uses the efficient up-sampling module to up-sample the deep feature maps, uses the multi-scale feature fusion module to perform bidirectional feature fusion with the feature maps of the same scale of the next layer, and adopts the small target detection branch to strengthen the detection effect of small targets; S6, training the target detection algorithm model by using the prepared data set, inputting the forward-looking sonar image into the trained model for reasoning, and obtaining the detection result of the typical underwater target; The process of the efficient up-sampling module for image processing comprises: The input image is down-sampled using multi-scale convolution, which is: where F down denotes the down-sampled output feature map, W i denotes the weights of the convolution kernel of different scales, F in,j is the input feature map, N is the number of different scales, and * denotes the convolution operation; The down-sampled feature map is processed through the channel attention CAB and the spatial attention SAB mechanism, which is: F CAB = σ(W2 ReLU(W1 GAP(X))) F SAB = σ(Conv 7×7 (X)) In the formula: F CAB represents the weight of channel attention, GAP represents global average pooling for each channel, W1 and W2 are weight matrices of two fully connected layers, X is an input feature map, ReLU represents an activation function ReLU, and σ represents a Sigmoid function for mapping channel weights to the interval (0, 1); F SAB represents the weight of spatial attention, X is an input feature map, and σ represents a Sigmoid function; Conv 7×7 represents a large kernel convolution; Through the up-sampling operation, the image enhanced by the channel attention CAB and the spatial attention SAB mechanism is restored to a higher resolution, and the feature map from the skip connection is fused through element-wise addition, which is: X' = X + CompKernel (X) Y upsample = Upsample(X) In the formula, X is an input down-sampled feature map, CompKernel(X) represents a correction of a feature map by a compensation kernel, Y upsample represents an output image after up-sampling, and Upsample(X) represents an up-sampling operation on the input X. When the skip connection is combined with the large convolution kernel grouping attention gate module, the feature map obtained by fusing the up-sampled feature map and the feature map of the skip connection is transmitted to the large convolution kernel grouping attention gate module, and finally the output feature map is obtained, which is: F EUCB = F fused x F CAB x F SAB In the formula, F fused is the feature map after the jump connection and up-sampling fusion, F EUCB is the output feature The process of the feature fusion network for image processing specifically comprises: down-sampling through a convolution with a step of 2 and performing feature fusion with adjacent deep feature maps through the multi-scale feature fusion module, up-sampling the deep feature map through the efficient up-sampling module and connecting it to the multi-scale feature fusion module to perform feature fusion with the adjacent shallow feature map of the previous layer, which is: P i = P fused (Conv(P i-1 ))+ P fused (F EUCB (P i+1 )) wherein P i represents the current layer feature map, P i-1 represents the adjacent shallow layer feature map, P i+1 represents the adjacent deep layer feature map; P fused (Conv(P i-1 )) represents down-sampling the previous layer feature map and connecting to the multi-scale feature fusion module, P fused (F EUCB (P i+1 )) represents efficient up-sampling the next layer feature map and connecting to the multi-scale feature fusion module; The detection algorithm model outputs image recognition results through a dynamic detection head.

2. The sonar image underwater detection method based on multi-scale feature fusion and efficient up-sampling algorithm according to claim 1, characterized in that, The step S1 specifically comprises: S1.1, collecting underwater sonar data of typical targets by using a forward-looking sonar; S1.2, extracting and converting sonar data, obtaining sonar images frame by frame, scaling all sonar images to a resolution of 1280x720 pixels, and labeling and making data sets according to requirements; S1.3, the mask annotation set is obtained by mask extraction on the sonar image, and is used as a basis for learning mask refinement in the target detection algorithm model training process.

3. The sonar image underwater detection method based on multi-scale feature fusion and efficient up-sampling algorithm according to claim 1, characterized in that: The typical targets include a conical target, a mesh target and an irregular target.

4. The sonar image underwater detection method based on multi-scale feature fusion and efficient up-sampling algorithm according to claim 1, characterized in that, The feature map is input to a backbone network of the target detection algorithm model for feature extraction, specifically including: The feature map is down-sampled four times in the backbone network part, and after the first down-sampling, it is connected to the feature fusion network again through a convolution with a step of 2 and a channel number of 256. The feature maps after other down-sampling are connected to the feature fusion network through a convolution with a step of 1 and a channel number of 256. The channel number of each layer of the feature map is fixed to 256, the input picture is adjusted to a fixed size, and normalized, which is: In the formula, I is the original input image, normalized to the interval [0, 1]; Then, the feature extraction backbone network Backbone of YOLOv11 is used, which is composed of a convolution with a step of 2, C3K2, a fast spatial pyramid pooling module and a point aggregation attention module. First, the image is feature segmented, which is: F1,F2=Split(F) In the formula, F1,F2 are different feature maps input, and Split(F) represents feature segmentation of the feature map; Then, two Bottleneck blocks are applied to F2, which is: F2'=Bottleneck2(Bottleneck1(F2)) In the formula, Bottleneck represents feature extraction stacking of the feature map; Then, the features F1 and F2' are spliced in the channel dimension: F cat = Concat(F1, F2') Finally, the features are fused, and the channel features are fused using a 1x1 convolution to obtain the final output, and the calculation formula is as follows: F out = Conv 1x1 (F1,F′2) The fast spatial pyramid pooling module extracts multi-scale features using different scale maximum pooling operations, and fuses these features through splicing and convolution to obtain: F1=MaxPool(F,k=5,s=1,padding=2)F2=MaxPool(F1,k=5,s=1,padding=2)F3=MaxPool(F2,k=5,s=1,padding=2) In the formula, the fast spatial pyramid pooling module adopts three times of maximum pooling operation, k=5 represents that the pooling kernel size is 5, s=1 represents that the step is 1, and padding=2 represents that the convolution edge filling coefficient is 2; The pooled feature maps F1, F2 and F3 are spliced in the channel dimension: F cat = Concat(F, F1, F2, F3) Finally, a 1x1 convolution layer is used to reduce the channel number and fuse the spliced features: F out = Conv 1x1 (F cat ) The point aggregation attention module of YOLOv11 performs feature segmentation through the C2 feature module, and inserts a point aggregation parallel spatial attention module in the middle. The input feature F is divided into F1 and F2 in the channel dimension. F1 is convolved to extract local features. F2 passes through a parallel spatial attention module to generate a set of attention weights and reweights the input features. The relevant calculation formula is as follows: F1,F2=Split(F) F'1 = Conv 3×3 (F1) F ca = σ(MLP(GAP(F2))) F sa = σ(Conv k×k (Concat(AvgPool(F2),MaxPool(F2)))) F psa = F2• F ca • F sa wherein: MLP is a multi-layer perceptron network, σ denotes a Sigmoid function, GAP denotes a global average pooling, AvgPool denotes an average pooling, MaxPool denotes a max pooling, F ca denotes a channel attention, F sa denotes a spatial attention.

5. The sonar image underwater detection method based on multi-scale feature fusion and efficient up-sampling algorithm according to claim 1, characterized in that, The multi-scale feature fusion module strengthens the process of multi-scale feature information fusion, and is characterized in that: The input multiple feature maps are initialized and fused by weight, activated by a ReLU function, normalized by weight, and finally weighted and summed to obtain the final fused feature map; the weighted sum formula is: where P fused is the fused output weight, is the normalized weight, and In the formula, ReLU is an activation function, and epsilon is a constant.

6. The sonar image underwater detection method based on multi-scale feature fusion and efficient up-sampling algorithm according to claim 5, characterized in that, The dynamic detection head outputs an image recognition result, which specifically includes: The dynamic detection head includes scale perception, spatial perception and task perception, and the three dimensions are generated by channel attention and spatial attention modules through channel and spatial dimensions to generate feature weights, and the calculation formula is: where: GAP(F l ) denotes global average pooling, W ca and b ca denote the weights and bias of the channel attention. Then the task attention module is used to the dynamic characteristics Respectively, the classification task and the regression task dynamically model where: W cls , b cls represent the weights and biases for the classification task, and W reg , b reg represent the weights and biases for the regression task. Then the output of the classification task and the regression task branch is obtained: where: W cls_out , b cls_out represent linear transformation parameters of the classification branch, W reg_out , b reg_out represent linear transformation parameters of the regression branch.

7. An underwater sonar image detection system implementing the method of any of claims 1-6, characterized by Including: A data set generation unit collects front-looking sonar data of underwater typical targets, extracts sonar metadata and converts coordinate axes, obtains sonar images frame by frame, arranges and labels the data set, and produces detection training and test data sets of sonar images; A target detection algorithm model construction unit constructs a feature fusion network including an efficient up-sampling module, a multi-scale feature fusion module and a small target detection branch, constructs a target detection algorithm model based on YOLOv11, uses the feature fusion network as the neck network of YOLOv11, and removes the deep feature map detection branch of YOLOv11; when the target detection algorithm model performs image processing, the feature map is input to the backbone network of the target detection algorithm model for feature extraction and input to the feature fusion network; the shallow feature maps of the backbone network and the feature fusion network are sequentially down-sampled by down-sampling, the feature fusion network simultaneously uses the efficient up-sampling module to up-sample the deep feature map, uses the multi-scale feature fusion module to perform bidirectional feature fusion with the same scale feature map of the next layer, and uses the small target detection branch to enhance the detection effect of small targets; A target detection unit trains the target detection algorithm model using the produced data set, inputs the front-looking sonar image into the trained model for inference, and obtains the detection result of the underwater typical target.