Underwater target detection method and device based on sonar image, equipment and medium

By using the YOLOv10 network model and adaptive image processing technology, the problem of noise interference in underwater target detection was solved, improving detection accuracy and precision.

CN119992307BActive Publication Date: 2026-02-13SHANGHAI DAHUA SURVEYING & MAPPING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510479569.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2026-02-13
Estimated Expiration
2045-04-17

AI Technical Summary

Technical Problem

Traditional underwater target detection methods based on sonar images are easily affected by noise in complex and variable underwater environments, leading to a decrease in image quality and affecting detection accuracy.

Method used

The YOLOv10 network model is used for underwater target detection. The weights of each channel of the sample image are adaptively adjusted by the inverted bottleneck fusion module and the SE block. The image preprocessing is combined with adaptive Wiener filtering and gray-level cumulative distribution function to improve the accuracy of feature extraction and target detection.

Benefits of technology

It simplifies the manual feature engineering process, improves the positioning accuracy and classification accuracy of underwater targets, and enhances the model's detection performance in complex underwater environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119992307B_ABST
    Figure CN119992307B_ABST
Patent Text Reader

Abstract

The application discloses a kind of underwater target detection methods, device and equipment based on sonar image and medium, it is related to underwater detection field, the method includes obtaining sonar image sample set, sonar image sample set includes sample image, and the sample label attached with each sample image, each sample label includes position information and class probability distribution, position information indicates the position information of the underwater target in sonar image, class probability distribution indicates the class probability distribution of underwater target;Obtain training set in sonar image sample set, and train initial underwater target detection model by training set, obtain underwater target detection model;Obtain the sonar image to be detected, and input the sonar image to be detected into underwater target detection model, output the position information and the class probability distribution.The application improves the accuracy of target detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of underwater detection, in particular to an underwater target detection method and device based on sonar images, equipment and medium. BACKGROUND

[0002] As an important means of underwater detection, sonar imaging technology plays a key role in underwater operations, ocean resource exploration, underwater security and other fields. Underwater target detection based on sonar images refers to the process of obtaining underwater environment images using sonar technology and identifying and locating underwater targets from these images.

[0003] Traditional target detection methods based on sonar images mainly rely on artificial feature extraction techniques such as edge detection and shape matching. These methods can identify and locate underwater targets to some extent. However, due to the complex and variable underwater environment, sonar images are easily affected by noise interference, water scattering, multipath effects and other factors, resulting in a decline in image quality, making it difficult for artificial features to accurately describe target characteristics in a noisy background, thus affecting the accuracy of detection. SUMMARY

[0004] The purpose of the present application is to provide an underwater target detection method, device, equipment and medium based on sonar images, which can improve the accuracy of target detection.

[0005] To achieve the above purpose, the present application provides the following solutions:

[0006] In a first aspect, the present application provides an underwater target detection method based on sonar images, comprising:

[0007] Obtaining a sonar image sample set, the sonar image sample set including sample images and sample labels attached to each sample image, each sample label including position information and class probability distribution, the position information indicating the position of the underwater target in the sonar image, and the class probability distribution indicating the class probability distribution of the underwater target;

[0008] Obtaining a training set in the sonar image sample set and training an initial underwater target detection model through the training set to obtain an underwater target detection model, the initial underwater target detection model being a YOLOV10 network model, the YOLOV10 network model including an inverted bottleneck fusion module integrated with an SE block to adaptively adjust the weight of each channel of the sample image in the feature extraction stage;

[0009] Obtaining a sonar image to be detected and inputting the sonar image to be detected into the underwater target detection model to output the position information and the class probability distribution.

[0010] In a second aspect, the present application provides a sonar image-based underwater target detection device, comprising:

[0011] A first obtaining module is configured to obtain a sonar image sample set, wherein the sonar image sample set comprises sample images and sample labels attached to each of the sample images, and each of the sample labels comprises position information and a class probability distribution, wherein the position information indicates the position of the underwater target in the sonar image, and the class probability distribution indicates the class probability distribution of the underwater target.

[0012] A training module is configured to obtain a training set from the sonar image sample set, and train an initial underwater target detection model based on the training set to obtain an underwater target detection model, wherein the initial underwater target detection model is a YOLOV10 network model, and the YOLOV10 network model comprises an inverted bottleneck fusion module integrated with an SE block to adaptively adjust the weight of each channel of the sample image in a feature extraction stage.

[0013] An input module is configured to obtain a to-be-detected sonar image, and input the to-be-detected sonar image into the underwater target detection model to output the position information and the class probability distribution.

[0014] In a third aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the sonar image-based underwater target detection method according to any one of the above embodiments.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the steps of the sonar image-based underwater target detection method according to any one of the above embodiments.

[0016] According to the embodiments of the present application, the following technical effects are achieved:

[0017] The present application applies the YOLOV10 network model in the field of underwater detection, extracts and learns the image features of the sonar image sample set by using the YOLOV10 network model, and predicts the exact position of each potential target and the probability distribution of the category to which the target belongs according to the to-be-detected sonar image, thereby simplifying the cumbersome manual feature engineering steps in the traditional method and improving the positioning accuracy and classification accuracy of the underwater target. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings described below only constitute some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0019] Figure 1 An application environment diagram of a kind of underwater target detection method based on sonar image provided by an embodiment of the present application;

[0020] Figure 2 A flowchart of a kind of underwater target detection method based on sonar image provided by an embodiment of the present application;

[0021] Figure 3 A flowchart of a kind of underwater target detection method based on sonar image provided by another embodiment of the present application;

[0022] Figure 4 A functional module diagram of a kind of underwater target detection method device based on sonar image provided by an embodiment of the present application;

[0023] Figure 5 A structural diagram of a kind of computer equipment provided by an embodiment of the present application. DETAILED DESCRIPTION

[0024] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0025] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0026] The underwater target detection method based on sonar image provided by the embodiments of the present application can be applied to, for example, Figure 1The application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data required by the server 104 to process. The data storage system can be set up separately, or integrated on the server 104, or placed on the cloud or other servers. The terminal 102 can send the to-be-processed sonar image sample set to the server 104. After receiving the to-be-processed sonar image sample set, the server 104 obtains the training set in the sonar image sample set, and trains the initial underwater target detection model through the training set to obtain the underwater target detection model. And get the to-be-detected sonar image, input the to-be-detected sonar image into the underwater target detection model, output the position information and the category probability distribution.

[0027] The server 104 can feed back the obtained position information and category probability distribution to the terminal 102. In addition, in some embodiments, the underwater target detection method based on sonar image can also be implemented by the server 104 or the terminal 102 alone, such as the terminal 102 can directly train the initial underwater target detection model for the training set in the to-be-processed sonar image sample set, or the server 104 can obtain the training set in the to-be-processed sonar image sample set from the data storage system and train the model for the training set in the to-be-processed sonar image sample set.

[0028] Among them, the terminal 102 can be but not limited to various desktop computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers, and can also be a cloud server.

[0029] In an exemplary embodiment, as Figure 2 shown, an underwater target detection method based on sonar image is provided, which is executed by a computer device, specifically can be executed by a terminal or a server computer device alone, or can be executed by a terminal and a server together. In the embodiment of the present application, the server 104 in the Figure 1 application environment is taken as an example for illustration, which includes the following steps S201 to S208. Among them:

[0030] In step S201, a sonar image sample set is obtained, which includes sample images and sample labels attached to each sample image. Each sample label includes position information and category probability distribution. The position information refers to the position information of the underwater target in the sonar image, and the category probability distribution refers to the category probability distribution of the underwater target.

[0031] The position information is target bounding box coordinates, which are expressed in the form of center coordinates, width, and height.

[0032] Before step S201, the underwater target detection method based on sonar images further includes the following step S200:

[0033] S200, an initial sonar image sample set is obtained, and the initial sonar images in the initial sonar image sample set are preprocessed to obtain a sonar image sample set.

[0034] In order to construct a comprehensive and diverse sonar image sample set, it is necessary to first use sonar equipment of various models to collect data under various water conditions. These conditions include but are not limited to changes in depth, water temperature, and water quality to ensure that the sample set can cover as many environmental conditions as possible. The targets collected cover a wide range of underwater entities, such as sunken ships, marine life, underwater pipelines, etc., ensuring that the diversity of samples not only lies in environmental factors but also in the richness of target types.

[0035] According to the detection requirements, sonar equipment with different frequency ranges, resolutions, and detection distances is selected to ensure that various targets from large structures (such as sunken ships) to small biological groups (such as fish schools) can be effectively captured. Sampling is carried out in multiple representative aquatic environments, including but not limited to freshwater lakes, saltwater bays, deep seas, etc., each environment has unique physical characteristics (such as temperature, salinity, turbidity), which will affect the propagation of sound waves.

[0036] The collected sonar images are denoised to remove interference caused by water scattering, device noise, etc., thereby improving image quality. Adaptive filtering algorithms such as adaptive Wiener filtering can be used to dynamically adjust filtering parameters according to the noise characteristics of local image regions to achieve better denoising effect. Adaptive Wiener filtering is a method that adjusts filter parameters based on the statistical characteristics of signals and noise. In the local region of the image, the filtering coefficients are dynamically determined according to the statistical quantities such as the mean and variance of the region. The purpose of this method is to make the filtered image closest to the initial noise-free image in the sense of mean square error.

[0037] In one embodiment, the initial sonar image sample set contains multiple initial sonar images, and step S200 further includes the following sub-steps S2001-S2002:

[0038] S2001, all initial sonar images are denoised by adaptive Wiener filtering algorithm.

[0039] S2002, all denoised initial sonar images are subjected to image enhancement processing to obtain a sonar image sample set.

[0040] In one embodiment, step S2001 comprises the following sub-steps S20011-S20015:

[0041] S20011, obtaining an initial sonar image.

[0042] Specifically, the initial sonar image can be obtained through a public database, or the sonar image of a specific area can be obtained through authorization.

[0043] S20012, calculating the local mean of each pixel point in the initial sonar image.

[0044] Specifically, suppose the initial sonar image (i.e. the observed noisy image) is denoted as , where denotes the initial noise-free sonar image, denotes the noise. In practical applications, the observed image can be represented as the superposition of the initial noise-free sonar image and the noise . The purpose of preprocessing is to reduce the influence of noise on the initial sonar image as much as possible, and to improve the image quality to restore or approach the state of the initial noise-free sonar image .

[0045] For a local region of size centered at pixel in the initial sonar image:

[0046] The local mean of each pixel point in the initial sonar image is calculated by the following formula: ;

[0047] where denotes the average value of the pixels in the local region centered at pixel , denotes the floor of , which is used to determine the range of the local region. If n = 5, then ; if n = 6, then .

[0048] Step S20012 is to estimate the background intensity of the current region, i.e. the overall brightness level of the image without considering the detail changes.

[0049] S20013, calculating the local variance of each pixel point in the initial sonar image.

[0050] The local variance of each pixel point in the initial sonar image The local variance is calculated by the following formula:

[0051] wherein, The variance is used to measure the dispersion of pixel values within a local region relative to the local mean. A high variance indicates that the pixel values within the region vary greatly, and there is a large amount of detail or edge information. A low variance indicates that the pixel values within the region vary little, and the region is relatively smooth.

[0052] S20014, according to the local mean and the local variance of each pixel point, the denoising value of each pixel point is calculated.

[0053] The adaptive Wiener filter can adjust the filter parameters according to the local characteristics of the image to achieve the denoising effect. The output of the adaptive Wiener filter is:

[0054]

[0055]

[0056] wherein, represents the image after adaptive Wiener filtering; the variance of the noise is assumed to be known; represents the average value of the pixels in the local region centered on the pixel ; represents the local variance of each pixel point ; the part of the signal that is preserved by the adaptive Wiener filter (based on the comparison of the local variance and the noise variance) while reducing the impact of the part that is considered to be noise. S20015, the step of calculating the denoising value of each pixel point is repeated, and each pixel point in the initial sonar image is traversed to obtain the initial sonar image after denoising processing.

[0057] When performing adaptive Wiener filtering, the algorithm traverses each pixel point in the initial sonar image

[0058] and calculates the local mean and the local variance for the pixel point, thereby performing denoising processing on the pixel. In order to calculate these local statistics, a small neighborhood or window (such as 5x5, 7x7, etc.) is usually defined around each pixel point, and this window is slid on the image so that each pixel point calculates statistics based on its surrounding pixels. Since each image may contain different noise patterns and content, each image in the initial sonar image sample set needs to be processed separately to achieve the best denoising effect.

[0059] ​​​​​In processing the initial sonar image sample set, the entire initial sonar image sample set needs to be loaded, and for each image in the sample set, the processing is sequentially performed.

[0060] In the sonar image, the interference such as water scattering and device noise has non-uniformity, and the noise characteristics of different regions can differ greatly. The adaptive Wiener filter can dynamically adjust the filtering parameters according to the noise characteristics of the local region of the image. Compared with the filtering method with fixed parameters (such as mean filtering, median filtering, etc.), it can better preserve the edge and detail information of the image, and at the same time more effectively remove the noise, thereby improving the quality of the sonar image and providing a better basis for subsequent target detection and other tasks.

[0061] In one embodiment, step S2002 includes the following sub-steps S20021-S20023:

[0062] S20021, determine the cumulative probability of each gray level in the initial sonar image after noise reduction according to the gray level cumulative distribution function.

[0063] Specifically, the gray level cumulative distribution function is represented by the following formula:

[0064] ;

[0065] wherein, for each gray level (wherein k is from 0 to L-1, L is the number of gray levels), the cumulative probability thereof is calculated ; represents the probability of the gray level appearing; represents the cumulative probability of the gray level and all gray levels less than appearing in the image.

[0066] S20022, determine the equalized gray value according to the cumulative probability.

[0067] Specifically, the gray level cumulative distribution function is linearly transformed to obtain a new gray value, i.e. the equalized gray value, which is represented by the following formula:

[0068] ;

[0069] wherein, represents the equalized gray value, represents the number of gray levels minus one, used to scale the cumulative probability to the gray level range.

[0070] S20023, apply the equalized gray value to each pixel point of the initial sonar image after noise reduction to generate a sonar image.

[0071] For each pixel in the initial sonar image , find the corresponding equalized gray value s according to its initial gray value r, replace the gray value of each pixel in the initial sonar image with the corresponding equalized gray value s, and generate a preprocessed image.

[0072] After the initial sonar image is histogram equalized, the distribution of its gray values becomes more uniform, which means that the contrast of the image is enhanced, the details of dark and bright parts are more clearly visible, and the overall quality of the image is improved.

[0073] In step S202, a training set in the sonar image sample set is obtained, and an initial underwater target detection model is trained through the training set to obtain an underwater target detection model. The initial underwater target detection model is a YOLOV10 network model.

[0074] In one embodiment, the step S202 "training the initial underwater target detection model through the training set to obtain an underwater target detection model" includes the following sub-steps S2021-S2023:

[0075] S2021, input the training set into the feature extraction network to obtain a first feature output, the feature extraction network includes at least one convolution module, at least one bottleneck fusion module, at least one feature splicing module, a spatial pyramid pooling module and a position squeezing attention module;

[0076] Specifically, the convolution module includes a first convolution module, a second convolution module, a third convolution module, a fourth convolution module, a fifth convolution module, a sixth convolution module and a seventh convolution module, the bottleneck fusion module includes a first bottleneck fusion module, a second bottleneck fusion module, a third bottleneck fusion module, a fourth bottleneck fusion module and a fifth bottleneck fusion module, the inverted bottleneck fusion module includes a first inverted bottleneck fusion module and a second inverted bottleneck fusion module, the up-sampling module includes a first up-sampling module and a second up-sampling module, and the feature splicing module includes a first feature splicing module, a second feature splicing module, a third feature splicing module and a fourth feature splicing module.

[0077] In one embodiment, as shown in Figure 3 , the step S2021 "inputting the training set into the feature extraction network to obtain a first feature output" includes the following sub-steps S20211-S202111:

[0078] S20211, input the sample image in the sample set into the first convolution module Conv1 of the feature extraction network for feature extraction to obtain a first feature map .

[0079] The sample image in step S20211 is obtained by preprocessing the initial sonar image after noise reduction and image enhancement processing. The purpose of preprocessing is to ensure that the image format input into the feature extraction network is consistent. The preprocessing process includes the following sub-steps A1-A4:

[0080] A1, scale the sample image to be processed.

[0081] Suppose the size of the sample image to be processed is W , the target is to adjust it to a size with a maximum side not exceeding S while keeping the aspect ratio unchanged. Let the scaling ratio be r, which is represented by the following formula:

[0082] ;

[0083] The size of the scaled image is:

[0084] =r·W, =r·W;

[0085] A2, normalize the scaled sample image to be processed.

[0086] Let the original pixel value be I(x,y), where x and y represent the horizontal and vertical coordinates of the pixel in the image, respectively. The normalized pixel value (x,y) can be represented as:

[0087] ;

[0088] The purpose of normalization is to convert the pixel value from the range [0, 255] to [0, 1] or other specified range.

[0089] A3, crop the normalized sample image to be processed to obtain the sample image.

[0090] The purpose of cropping is to extract a fixed size region from the image. Suppose the cropping size is , calculate the center point position of the picture:

[0091] , ;

[0092] Crop a square region with C as the center and the side length as C:

[0093] = ;

[0094] where є[0,1]. ​​

[0095] The input sample image X is convoluted through a series of convolutional layers to generate a first feature map 1. The calculation formula of convolution processing is:

[0096] ;

[0097] wherein, is the coordinate of the first feature map 1, is the coordinate of the convolution kernel, and is the size of the convolution kernel.

[0098] The size of the convolution kernel directly affects the effect of feature extraction. Small size convolution kernel (3x3) has a small receptive field, which can capture the fine texture and detail information in the image. In sonar images, when processing images with fine structure (such as the scale texture of small fish), small size convolution kernel can more accurately extract these fine features. Large size convolution kernel (5x5 or 7x7) has a large receptive field, which can focus on the overall contour of the target. For example, when detecting large targets such as sunken ships, large size convolution kernel can obtain the overall shape and general structure information of the target.

[0099] In step S20211, the sample image X in the sample set is input into the first convolution module Conv1 of the feature extraction network as 5x5 to extract features and obtain the first feature map The convolution kernel is 3x3, the padding is 1, and the step is 1. The convolution kernel will slide from left to right and from top to bottom on the sample image, covering a 3x3 area each time, and since the step is 1 and the padding is 1. The value at position is calculated by the following formula:

[0100] ;

[0101] wherein b represents the bias term, which is a constant.

[0102] For each position , the entire input sample image X is traversed to generate a complete first feature map .

[0103] S20212, input the first feature map into the second convolution module Conv2 of the feature extraction network to extract features and obtain the second feature map .

[0104] The convolution kernel of the second convolution module Conv2 is 3x3, the padding is 1, and the step is 1. The specific calculation process is as described in the previous steps, which will not be repeated here.

[0105] S20213. Input the first feature map and the second feature map into the first bottleneck fusion module of the feature extraction network for feature fusion to obtain the third feature map.

[0106] Specifically, this application adds a fusion strategy to the first bottleneck fusion module c2f1 of the YOLOv10 network model, instead of implementing it through simple concatenation and direct addition. In existing bottleneck fusion modules, feature maps extracted from different layers are directly concatenated along the channel dimension. While this increases the network's receptive field and feature representation ability, it does not consider the differences in the importance of features at different scales. Adding feature maps directly at different scales, although capable of integrating multi-scale information, may lead to the masking or neglect of important information because the importance of features at each scale is not adjusted.

[0107] Assumption It is a high-resolution feature map with low semantic information, while It is a low-resolution feature map with high semantic information. To achieve multi-scale feature fusion, upsampling and downsampling methods are used to adjust the size of the two feature maps so that they can be aligned in the spatial dimension.

[0108] for The resolution is reduced by applying an average pooling operation with a step size of 2, denoted as:

[0109] ;

[0110] for To increase its resolution, bilinear interpolation or upsampling techniques are used, denoted as:

[0111] ;

[0112] Integration strategies include:

[0113] Adjusted feature map and Combined, that is, spliced ​​together according to the channel dimension, it is represented as [ ; ].if have One channel, have There are several channels, which, when spliced ​​together, have One channel.

[0114] Through learnable parameter matrix A linear transformation is performed on the concatenated feature maps to obtain a new feature map. The new feature map is then passed through the Softmax function to obtain the attention map A. Attention map A is represented by the following formula:

[0115] ;

[0116] Attention map Each element of the attention map represents the relative importance of the two feature maps and at the corresponding position. The input value is converted to a probability distribution by the Softmax function, so that the sum of all elements is 1, and each element is between 0 and 1, the larger the value, the higher the importance of the corresponding feature at that position.

[0117] The feature maps and are weighted by the attention map A to obtain the final fusion result , which is represented by the following formula:

[0118] ;

[0119] In the above formula, represents multiplying each element in the attention map A with the element at the corresponding position in , which is equivalent to weighting . Similarly, represents weighting , where 1−A is the complement of A, representing the relative importance of . Finally, the weighted two feature maps are added to obtain the fused feature map .

[0120] The traditional simple concatenation or direct addition method does not consider the importance difference of different feature maps. While the weighted sum allows different weights to be assigned to different feature maps, so that the model can emphasize certain specific information as needed. Through the learned optimal weight, the model can more effectively integrate information from different scales or depths, thereby improving the quality of the final output. Through the learned attention map, the model can focus on the most important areas or features, ignoring irrelevant or noise information, which helps to improve the recognition accuracy.

[0121] S20214, input the third feature map into the third convolutional module Conv3 of the feature extraction network for feature extraction to obtain the fourth feature map .

[0122] The convolution kernel of the third convolutional module Conv3 is 3×3, the padding is 1, and the step is 1. The specific calculation process is as shown in the foregoing steps, which will not be repeated here.

[0123] S20215, input the third feature map and the fourth feature map​ The second bottleneck fusion module c2f2 of the input feature extraction network is used for feature fusion to obtain a fifth feature map .

[0124] The specific calculation process is as shown in the foregoing steps, which will not be repeated here.

[0125] S20216, the fifth feature map The fourth convolution module Conv4 of the input feature extraction network is used for feature extraction to obtain a sixth feature map.

[0126] The convolution kernel of the fourth convolution module Conv4 is 5x5, the padding is 1, and the step is 1. The specific calculation process is as shown in the foregoing steps, which will not be repeated here.

[0127] S20217, the fifth feature map and the sixth feature map The third bottleneck fusion module c2f3 of the input feature extraction network is used for feature fusion to obtain a seventh feature map .

[0128] The specific calculation process is as shown in the foregoing steps, which will not be repeated here.

[0129] S20218, the seventh feature map The fifth convolution module Conv5 of the input feature extraction network is used for feature extraction to obtain an eighth feature map .

[0130] The convolution kernel of the fifth convolution module Conv5 is 5x5, the padding is 1, and the step is 1. The specific calculation process is as shown in the foregoing steps, which will not be repeated here.

[0131] In YOLOv10, multiple convolution modules (Conv) are sequentially set, the purpose is to gradually extract and refine the features in the input data. It helps to improve the detection ability of the model for targets of different scales, and enhances the learning ability and generalization performance of the model. Each convolution layer can capture different levels of information. Shallow convolution usually learns low-level features such as edges and colors; while deep convolution can recognize more complex structures, such as part or whole shape of an object. By stacking multiple convolution layers, the network can extract more and more abstract and high-level feature representations from the initial image layer by layer. With the increase of convolution layers, the receptive field of neurons gradually expands. This means that the deep convolution kernel can cover a larger image area, which helps to recognize larger size targets or understand global context information.

[0132] S20219, the eighth feature map The first inverted bottleneck fusion module C2fCIB1 of the input feature extraction network is used for feature optimization to obtain a ninth feature map .

[0133] The eighth feature map input is adjusted in channel, and the size of is HxWxC, and the channel number is adjusted by 1x1 convolution first:

[0134] ;

[0135] wherein, represents a 1x1 convolution operation with a step of 1 and no padding.

[0136] The depth separable convolution and the dilated convolution are applied to process the , and the formula is as follows:

[0137] ;

[0138] wherein, represents a depth separable convolution, represents a dilated convolution with a dilated rate d.

[0139] An inverted bottleneck structure is adopted to improve the calculation efficiency and the nonlinear expression ability:

[0140] ;

[0141] wherein, ReLU6 is an activation function, the output range of the activation function is between 0 and 6, and the gradient vanishing is prevented.

[0142] A Squeeze-and-Excitation (SE) block is added to enhance the important features of the image and suppress the noise:

[0143] The SE processing is performed on the by the SE block, and the process of the SE processing is realized by the following formula:

[0144] ;

[0145] wherein, represents a sigmoid activation function, the range is between 0 and 1, represents a ReLU activation function;

[0146] represents a global average pooling operation performed on each channel, that is, the entire feature map is compressed into a value in the spatial dimension. If the size of is HxWxC, the size of is 1x1xC. u represents a channel weight vector, and the importance of each channel is adjusted by multiplying u with .

[0147] This application incorporates an SE block into the inverted bottleneck fusion module to adaptively adjust the weights of each channel. Both the feature extraction and feature fusion networks of the YOLOv10 network model include the inverted bottleneck fusion module. Since the SE block is integrated into the inverted bottleneck fusion module, it adaptively adjusts the weights of each channel in the input feature map, i.e., it acts on the feature map obtained after processing by previous layers. The SE block performs a nonlinear transformation on the global information using the ReLU6 and sigmoid activation functions to generate the weight coefficients for each channel. In this way, the SE block can adaptively emphasize feature channels that are more important to the current task while suppressing less important feature channels, thereby enhancing important image features and suppressing noise. This mechanism allows the YOLOv10 network model to focus more on features that are substantially helpful for underwater target detection.

[0148] Furthermore, the feature extraction network and feature fusion network in this application achieve effective fusion and extraction of multi-scale features by combining the inverted bottleneck fusion module with the SE block. This structure not only enhances the YOLOv10 network model's ability to perceive underwater targets of different sizes, but also optimizes the feature representation ability by adaptively adjusting channel weights, enabling the model to maintain high detection performance even in complex and ever-changing underwater environments. In addition, since the SE block only operates on the channel dimensions of the feature map, its computational cost is relatively low. This allows the YOLOv10 network model to maintain high-precision detection while also maintaining fast inference speed, which is particularly important for underwater detection tasks requiring real-time feedback.

[0149] The above processed feature map and The ninth feature map is obtained by performing a weighted summation. It can be expressed by the following formula:

[0150] ;

[0151] in, This represents a coefficient between 0 and 1.

[0152] S202110, the ninth feature map The Spatial Pyramid Pooling (SPPF) module of the input feature extraction network is used for multi-scale pooling and feature integration to obtain the tenth feature map. .

[0153] Specifically, the SPPF module extracts feature information at different levels through multi-scale max pooling operations, and then integrates the feature information from different levels to better capture the spatial information of the input image. Assume the feature map input to the SPPF module is... , size H x W x C.

[0154] Using different size of pooling kernel on input feature map Perform max pooling operation. Three different pooling scales are adopted: k1, k2 and k3. For each pooling scale ki, apply max pooling operation:

[0155] ;

[0156] denotes max pooling operation on input feature map using pooling kernel with size ki x ki.

[0157] Since the size of feature map after max pooling operation will be smaller, it is necessary to upsample to the initial size H x W so as to align with the output feature map . The upsample process is represented by the following formula:

[0158] ;

[0159] Concatenate all upsampled feature maps with the initial feature map along the channel dimension: F = [; U1; U2; U3], where [; ] denotes the concatenation operation along the channel dimension. SPPF can capture information of different scales of images by using different size of pooling kernel on input feature map to perform max pooling operation. This multi-scale feature extraction capability enables the model to better recognize targets of different sizes and shapes. In the task of target detection, it helps to improve the detection accuracy of small targets, large targets and targets of various scales.

[0160] S2021 1, input the tenth feature map to the position squeeze and attention module PSA of the feature extraction network for attention mechanism processing to obtain the eleventh feature map .

[0161] Specifically, 1 x 1 convolution is performed on the input feature map to convert it into query vector and value vector :

[0162] ;

[0163] ;

[0164] Calculate the spatial attention weight through the query vector and the value vector:​​

[0165] ;

[0166] The attention weights of the channel branch are obtained by 1x1 convolution, LayerNom function and Sigmoid function:

[0167] ;

[0168] The attention weights of the spatial branch are finally obtained by reshape and Sigmoid function:

[0169] ;

[0170] The attention weights of the channel branch and the attention weights of the spatial branch are directly multiplied with the input features, and then the results are added to obtain the final output (eleventh feature map ):

[0171] ;

[0172] This step combines the channel dimension (different feature maps) and the spatial dimension (position information within the feature map), so that the model can more accurately capture subtle changes and complex structures in the image, thereby improving the accuracy in the recognition task.

[0173] S2022, input the first feature output into the feature fusion network to obtain a second feature output, the feature fusion network comprising at least one convolution module, at least one up-sampling module, at least one feature concatenation module, at least one bottleneck fusion module and at least one inverted bottleneck fusion module.

[0174] In one embodiment, the first feature output comprises a fifth feature map, a seventh feature map and an eleventh feature map; the second feature output comprises a sixteenth feature map, a nineteenth feature map and a twenty-second feature map. The step S2022 of "inputting the first feature output into the feature fusion network to obtain the second feature output" comprises the following sub-steps S20221-S202211:

[0175] S20221, input the eleventh feature map into the first up-sampling module UnSample1 of the feature fusion network for size enhancement of the high-level semantic feature map to obtain a twelfth feature map .

[0176] Specifically, the input eleventh feature map is up-sampled by using a bilinear interpolation method, assuming that the size of the input eleventh feature map is HxWxC, it needs to be sampled to the size of 2Hx2WxC, for each pixel in the output feature map ​ , calculate the position and weight of the four adjacent pixels corresponding to it in the input feature map .

[0177] Calculate the difference factor:

[0178] ;

[0179] ;

[0180] Calculate the weight according to the difference factor:

[0181] ;

[0182] ;

[0183] ;

[0184] ;

[0185] Weighted average of adjacent pixels using the above four weights: :

[0186] ;

[0187] wherein, represents the position of the four adjacent pixels corresponding to in the input feature map .

[0188] S20222, input the twelfth feature map and the seventh feature map to the first feature splicing module Concat1 of the feature fusion network to splice, and obtain the thirteenth feature map .

[0189] Specifically, before feature splicing, it is necessary to first ensure that the two input feature maps are consistent in spatial dimensions (i.e. height and width). If and do not match in size, one of the feature maps needs to be adjusted to achieve consistency in size.

[0190] Up-sampling can be used to adjust to the same size as :

[0191] ;

[0192] ;

[0193] After alignment processing and The dimensions are H×W× and H×W× Then the spliced The dimensions are H×W× , =[ ; ], where [;] represents the splicing operation in the channel dimension.

[0194] S20223, the thirteenth feature map The fourth bottleneck fusion module c2f4 of the input feature fusion network is used for feature fusion to obtain the fourteenth feature map.

[0195] The specific calculation process is as described in the steps above, and will not be repeated here.

[0196] S20224. Input the fourteenth feature map into the second upsampling module UnSample2 of the feature fusion network to perform high-level semantic feature map size enhancement to obtain the fifteenth feature map.

[0197] The specific calculation process is as described in the steps above, and will not be repeated here.

[0198] S20225. Input the fifteenth feature map and the fifth feature map into the second feature splicing module Concat2 of the feature fusion network for splicing to obtain the sixteenth feature map.

[0199] The specific calculation process is as described in the steps above, and will not be repeated here.

[0200] S20226, The sixteenth feature map The sixth convolutional module (Conv6) of the input feature fusion network is used for feature extraction to obtain the seventeenth feature map. .

[0201] The sixth convolutional module, Conv6, has a 7×7 kernel, padding of 1, and stride of 1. The specific calculation process is as described in the previous steps and will not be repeated here.

[0202] S20227, the seventeenth feature map and the fourteenth feature map The input feature fusion network's third feature concatenation module, Concat3, is used for concatenation to obtain the eighteenth feature map. .

[0203] The specific calculation process is as described in the steps above, and will not be repeated here.

[0204] S20228, the eighteenth feature map The fifth bottleneck fusion module c2f5 of the input feature fusion network performs feature fusion to obtain a nineteenth feature map.

[0205] The specific calculation process is as shown in the foregoing steps, which will not be described here.

[0206] S20229, the nineteenth feature map The seventh convolution module Conv7 of the input feature fusion network performs feature extraction to obtain a twentieth feature map .

[0207] The convolution kernel of the seventh convolution module Conv7 is 7*7, the padding is 1, and the step is 1. The specific calculation process is as shown in the foregoing steps, which will not be described here.

[0208] S202210, the twentieth feature map and the eleventh feature map The fourth feature splicing module Concat4 of the input feature fusion network performs splicing to obtain a twenty-first feature map .

[0209] The specific calculation process is as shown in the foregoing steps, which will not be described here.

[0210] S202211, the twenty-first feature map The second inverted bottleneck fusion module C2fCIB2 is input to perform feature optimization to obtain a twenty-second feature map .

[0211] The specific calculation process is as shown in the foregoing steps, which will not be described here.

[0212] S2023, the second feature output is input into the output network to obtain a prediction result, the prediction result includes position information and category probability distribution, and the difference between the comparison sample label and the prediction result is compared to adjust the model parameters to obtain an underwater target detection model. The output network includes a plurality of target detection head modules, each target detection head module includes two target detection head sub-modules, and the target detection head module is used for detecting targets of different scales.

[0213] In one embodiment, "inputting the second feature output into the output network to obtain a prediction result" in step S2023 includes the following sub-steps S20231-S20233:

[0214] S20231, the sixteenth feature map is input into the first target head module to obtain two groups of different first target position information and category probability distribution, wherein the first target head module includes a first target head sub-module One-to-many Head1 and a second target head sub-module One-to-many Head2.

[0215] S20232, the nineteenth feature map is inputted The second target head module is inputted to obtain two groups of different position information and category probability distribution of the second target, wherein the second target head module comprises a third target head sub-module One-to-many Head3 and a fourth target head sub-module One-to-many Head4.

[0216] S20233, the twenty-second feature map is inputted The third target head module is inputted to obtain two groups of different position information and category probability distribution of the third target, wherein the third target head module comprises a fifth target head sub-module One-to-many Head5 and a sixth target head sub-module One-to-many Head6.

[0217] Specifically, different target head modules are used to predict the bounding box coordinates of different targets. If the sample picture obtained has a sunken ship, a life buoy and a marine organism, the bounding box coordinates and the category probability of the three objects can be detected through the three different target head modules (the first target head module, the second target head module and the third target head module).

[0218] The center coordinates of the detected target bounding box are represented as (x, y), and the width and height of the detected target bounding box are represented as (w, h). These coordinate values are proportional values relative to the feature map, and need to be converted to the coordinate space of the initial image through a mapping relationship. The model usually makes predictions on a feature map. The feature map is a simplified representation of the initial image after a series of convolution, pooling and other operations, and the size is much smaller than that of the initial image. Therefore, the model directly obtains the target bounding box coordinates (such as the center point (x, y) and the width and height (w, h)) on the feature map, which are proportional values based on the size of the feature map.

[0219] Suppose the sample image size is HxW, the size of the feature map is x , then the coordinate calculation formula of the bounding box in the sample image is:

[0220]

[0221]

[0222] wherein (X, Y) represents the center coordinates of the bounding box in the sample image, represents the width of the target bounding box in the sample image, i.e. the actual width of the target bounding box, ​represents the height of the predicted target bounding box in the sample image, i.e., the actual height of the target bounding box.

[0223] For each bounding box, the output network calculates an initial score for each class , where c represents the class index, represents the model's preliminary estimate of the given bounding box belonging to class c, and the initial score is converted into a probability distribution by the Softmax function. The Softmax function can ensure that the sum of the predicted probabilities of all classes is equal to 1, which can be interpreted as the probability of belonging to each class. The probability of the target belonging to class c is represented by the following formula:

[0224]

[0225] where, represents the initial score of the corresponding class c in the output network, and C represents the total number of classes. If a target is predicted by two different target head sub-modules (e.g., One-to-many Head1 and One-to-many Head2), then the probability distributions given by the two target head sub-modules need to be compared, and the prediction with higher probability is selected as the final result. Assuming that for the same bounding box, the maximum probability predicted by One-to-many Head1 is and the maximum probability predicted by One-to-many Head2 is , then the larger one is selected as the final probability:

[0226]

[0227] The class corresponding to the maximum probability is selected as the target class within the bounding box. For example, if the class corresponding to the maximum probability is a life buoy, then the target within the bounding box is considered to be a life buoy. Similarly, One-to-many Head3 and One-to-many Head4, as well as One-to-many Head5 and One-to-many Head6, also predict the same bounding box.

[0228] Generating bounding boxes from feature maps, then predicting the class for each bounding box, and making a final classification decision based on the predicted probability distribution improves the accuracy of target detection, and also allows the model to dynamically adjust the position of the bounding box, further improving the positioning accuracy. In addition, by comparing the outputs of different target head sub-modules, the robustness and reliability of the model are enhanced.

[0229] In step S203, the sonar image to be detected is obtained, and the sonar image to be detected is input into the underwater target detection model to output position information and class probability distribution.

[0230] In one embodiment, the underwater target detection method based on sonar image further comprises the following steps S301-S302:

[0231] S301, obtain a verification set in the sonar image sample set, and input the verification set into the underwater target detection model to output a verification result corresponding to the sample image in the verification set.

[0232] S302, measure the difference between the verification result and the sample label according to the cross-entropy loss function, so as to guide the underwater target detection model to update parameters.

[0233] Specifically, the cross-entropy loss value of a single sample is expressed by the following formula:

[0234] = log( ) ;

[0235] Wherein, represents the true label of sample i belonging to class c (1 if belonging to, otherwise 0), represents the probability of model predicting that sample i belongs to class c.

[0236] The cross-entropy loss of the whole verification set is the average value of all sample losses, which is expressed by the following formula:

[0237] = ;

[0238] Wherein, N represents the number of samples in the verification set, and C represents the total number of classes.

[0239] The model parameters are updated by an optimization algorithm , and the update rule is expressed by the following formula:

[0240] ;

[0241] Wherein, represents the model parameters, represents the learning rate, represents the gradient of the loss function with respect to the parameter .

[0242] In order to accelerate the convergence speed and avoid falling into local optimal solution, the momentum term is selected in the parameter updating process, and not only the current gradient direction but also the previous updating direction is considered when updating the parameters, and the updating formula is as follows:

[0243] ;

[0244] wherein, denotes a velocity variable, denotes a momentum parameter (e.g. 0.9), t denotes the number of iterations. The process from calculating the average cross-entropy loss to updating the parameters is repeated until the loss function of the model reaches a predetermined convergence condition or reaches the maximum number of iterations. In each iteration process, the model gradually learns better parameter configurations.

[0245] In the actual application scenario of deep-sea resource exploration, the underwater target detection device based on sonar images in the application is mounted on the bottom of the unmanned ship to ensure that the device is stable and can withstand the pressure and water flow impact of the deep-sea environment. Start the sonar image acquisition module, which is equipped with high-precision sonar sensors and can continuously acquire sonar images of the surrounding water area during the scheduled route. The acquisition frequency is set to 1 frame per second to ensure comprehensive coverage without missing any potential resource or biological targets. All collected image data is recorded and stored in real time to the processor for subsequent analysis and backtracking. The collected images are transmitted in real time to the data processing unit through wireless or wired means to ensure the timeliness of data flow. The processor quickly processes the images according to the pre-set denoising and enhancement algorithms, which may include filtering, contrast enhancement, edge detection, etc., to improve image quality. The processing time is controlled within 0.5 seconds per frame to ensure efficient data processing without affecting subsequent analysis and decision-making.

[0246] The processed images are input into the underwater target detection model. The model outputs the target detection results within 0.2 seconds, including potential underwater mineral resource targets, surrounding marine biological targets, etc. The detected target information is transmitted to the result display and storage module to provide real-time feedback to the operator. The operator can view the detection results in real time through the display screen, which may be displayed in the form of graphics, lists or maps for easy understanding and analysis. According to the location and category information of the target, the operator can command the unmanned ship to further approach the key target area for more detailed detection. The storage module records all the data of this detection, including image data, processing results, operation records, etc., to provide a basis for subsequent data analysis. After the detection is completed, the stored data is analyzed in detail, including resource distribution, biodiversity, environmental impact, etc. Based on the analysis results, decision support is provided for resource development, environmental protection, scientific research, etc. A detailed detection report is generated, including images, data, analysis results and suggestions, for reference by relevant parties. Throughout the detection process, the unmanned ship and the device are monitored in real time to ensure safe operation of the equipment and timely response to possible faults or abnormal situations. Monitor changes in the surrounding environment, such as water flow, temperature, pressure, etc., to ensure that the detection activities do not have a negative impact on the marine environment. Through the above process, deep-sea resource exploration operations can be efficiently and accurately carried out to provide scientific basis for the development and protection of marine resources.

[0247] Based on the same inventive concept, the embodiments of the present application also provide an underwater target detection device based on sonar images. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more embodiments of the underwater target detection device based on sonar images provided below can refer to the limitations of the underwater target detection method based on sonar images described above, and will not be repeated here.

[0248] In one exemplary embodiment, as shown in Figure 4 An underwater target detection device based on sonar images is provided, comprising:

[0249] The first acquisition module 410 is configured to acquire a sonar image sample set, wherein the sonar image sample set comprises sample images and sample labels attached to each of the sample images, and each of the sample labels comprises position information and a class probability distribution, wherein the position information indicates the position information of the underwater target in the sonar image, and the class probability distribution indicates the class probability distribution of the underwater target.

[0250] The training module 420 is configured to acquire a training set in the sonar image sample set, and train an initial underwater target detection model through the training set to obtain an underwater target detection model, wherein the initial underwater target detection model is a YOLOV10 network model, and the YOLOV10 network model comprises an inverted bottleneck fusion module integrated with an SE block to adaptively adjust the weight of each channel of the sample image in a feature extraction stage.

[0251] The input module 430 is configured to acquire a to-be-detected sonar image, and input the to-be-detected sonar image into the underwater target detection model to output the position information and the class probability distribution.

[0252] As an optional implementation, the underwater target detection device based on sonar images further comprises:

[0253] The second acquisition module is configured to acquire an initial sonar image.

[0254] The first calculation module is configured to calculate the local mean value of each pixel point in the initial sonar image.

[0255] The second calculation module is configured to calculate the local variance of each pixel point in the initial sonar image.

[0256] The third calculation module is configured to calculate the denoising value of each pixel point according to the local mean value and the local variance of each pixel point.

[0257] The traversal module is configured to repeatedly calculate the de-noising value of each pixel point, traverse each pixel point in the initial sonar image, and obtain the initial sonar image after de-noising processing.

[0258] The first determination module is configured to determine a cumulative probability of each gray level in the initial sonar image after de-noising processing according to a gray cumulative distribution function.

[0259] The second determination module is configured to determine the equalized gray value according to the cumulative probability.

[0260] The generation module is configured to apply the equalized gray value to each pixel point of the initial sonar image after de-noising processing, and generate the sonar image.

[0261] As an optional implementation, the training module 420 is specifically configured to:

[0262] input the training set into a feature extraction network to obtain a first feature output, the feature extraction network comprising at least one convolution module, at least one bottleneck fusion module, at least one feature splicing module, a spatial pyramid pooling module, and a position squeezing attention module;

[0263] input the first feature output into a feature fusion network to obtain a second feature output, the feature fusion network comprising at least one convolution module, at least one up-sampling module, at least one feature splicing module, at least one bottleneck fusion module, and at least one inverted bottleneck fusion module;

[0264] input the second feature output into an output network to obtain a prediction result, the prediction result comprising the position information and the category probability distribution, compare the difference between the sample label and the prediction result to adjust the model parameters, and obtain the underwater target detection model, the output network comprising a plurality of target detection head modules, each target detection head module comprising two target detection head sub-modules, and the target detection head module being configured to detect targets of different scales.

[0265] As an optional implementation, the convolution module comprises a first convolution module, a second convolution module, a third convolution module, a fourth convolution module, a fifth convolution module, a sixth convolution module, and a seventh convolution module, the bottleneck fusion module comprises a first bottleneck fusion module, a second bottleneck fusion module, a third bottleneck fusion module, a fourth bottleneck fusion module, and a fifth bottleneck fusion module, the inverted bottleneck fusion module comprises a first inverted bottleneck fusion module and a second inverted bottleneck fusion module, the up-sampling module comprises a first up-sampling module and a second up-sampling module, and the feature splicing module comprises a first feature splicing module, a second feature splicing module, a third feature splicing module, and a fourth feature splicing module.

[0266] The first feature output includes a fifth feature map, a seventh feature map, and an eleventh feature map, the fifth feature map being obtained by inputting the third feature map and the fourth feature map into the second bottleneck fusion module for feature fusion, the seventh feature map being obtained by inputting the fifth feature map and the sixth feature map into the third bottleneck fusion module for feature fusion, and the eleventh feature map being obtained by inputting the tenth feature map into the position extrusion attention module for attention mechanism processing;

[0267] The second feature output includes a sixteenth feature map, a nineteenth feature map, and a twenty-second feature map, the sixteenth feature map being obtained by inputting the fifteenth feature map and the fifth feature map into the second feature splicing module for splicing, the nineteenth feature map being obtained by inputting the eighteenth feature map into the fifth bottleneck fusion module for feature fusion, and the twenty-second feature map being obtained by inputting the twenty-first feature map into the second inverted bottleneck fusion module for feature optimization.

[0268] As an optional implementation, in the aspect of obtaining a prediction result by inputting the second feature output into an output network, the training module 420 is specifically configured to:

[0269] input the sixteenth feature map into a first target head module to obtain the position information and the category probability distribution of two different first targets, wherein the first target head module includes a first target head submodule and a second target head submodule;

[0270] input the nineteenth feature map into a second target head module to obtain the position information and the category probability distribution of two different second targets, wherein the second target head module includes a third target head submodule and a fourth target head submodule;

[0271] input the twenty-second feature map into a third target head module to obtain the position information and the category probability distribution of two different third targets, wherein the third target head module includes a fifth target head submodule and a sixth target head submodule.

[0272] As an optional implementation, the position information is target bounding box coordinates, and the target bounding box coordinates are represented in the form of center coordinates, width, and height.

[0273] As an optional implementation, the underwater target detection device based on a sonar image further includes:

[0274] a second acquisition module configured to acquire a verification set in the sonar image sample set, input the verification set into the underwater target detection model, and output a verification result corresponding to the sample image in the verification set;

[0275] a guiding module configured to measure a difference between the verification result and the sample label according to a cross-entropy loss function, so as to guide the underwater target detection model to update parameters.

[0276] In an exemplary embodiment, a computer device, which can be a server or a terminal, is provided, and an internal structure diagram of the computer device can be as shown in Figure 5 The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store a sonar image sample set. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through network connection. The computer program is executed by the processor to implement a sonar image-based underwater target detection method.

[0277] Those skilled in the art can understand that Figure 5 The structure shown in the above

[0278] In an exemplary embodiment, a computer device is also provided, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0279] In an exemplary embodiment, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.

[0280] In an exemplary embodiment, a computer program product is provided, which includes a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.

[0281] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.

[0282] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments of each method. In the embodiments provided in the present application, any reference to memory, database or other medium can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc.

[0283] The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a blockchain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0284] The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, but as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0285] The principles and implementations of the present application are described in detail herein with specific examples. The above examples are only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation and application range will be changed. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A method for underwater target detection based on sonar images, characterized in that, The underwater target detection method based on sonar images includes: Acquire a sonar image sample set, the sonar image sample set including sample images and sample labels attached to each sample image, each sample label including location information and category probability distribution, the location information referring to the location information of the underwater target in the sonar image, and the category probability distribution referring to the category probability distribution of the underwater target; A training set is obtained from the sonar image sample set, and an initial underwater target detection model is trained using the training set to obtain an underwater target detection model. The initial underwater target detection model is a YOLOv10 network model, which includes an inverted bottleneck fusion module. The inverted bottleneck fusion module integrates an SE block to adaptively adjust the weight of each channel of the sample image during the feature extraction stage. Acquire a sonar image to be detected, input the sonar image to be detected into the underwater target detection model, and output the location information and the category probability distribution; The initial underwater target detection model includes a feature extraction network, a feature fusion network, and an output network. The training set is input into the feature extraction network to obtain the first feature output. The feature extraction network includes at least one convolutional module, at least one bottleneck fusion module, at least one feature concatenation module, a spatial pyramid pooling module, and a positional squeezing attention module. The first feature output is input into the feature fusion network to obtain the second feature output. The feature fusion network includes at least one convolutional module, at least one upsampling module, at least one feature concatenation module, at least one bottleneck fusion module, and at least one inverted bottleneck fusion module. The second feature is input into the output network to obtain the prediction result, which includes the location information and the category probability distribution. The difference between the sample label and the prediction result is compared to adjust the model parameters and obtain the underwater target detection model. The output network includes multiple target detection head modules, each of which contains two target detection head sub-modules. The target detection head modules are used to detect targets of different scales. The bottleneck fusion module includes a fusion strategy, which includes: concatenating the two adjusted feature maps along the channel dimension; performing a linear transformation on the concatenated feature maps using a learnable parameter matrix to obtain a new feature map; passing the new feature map through the Softmax function to obtain an attention map; and weighting the two feature maps using the attention map to obtain the fused feature map.

2. The sonar image-based underwater target detection method according to claim 1, characterized by, Before acquiring the sonar image sample set, the underwater target detection method for the sonar images includes: Acquire initial sonar images; Calculate the local mean of each pixel in the initial sonar image; Calculate the local variance of each pixel in the initial sonar image; The denoising value of each pixel is calculated based on the local mean and local variance of each pixel. Repeat the step of calculating the denoising value of each pixel, traverse each pixel in the initial sonar image, and obtain the denoised initial sonar image; The cumulative probability of each gray level appearing in the denoised initial sonar image is determined based on the cumulative gray-level distribution function. Based on the cumulative probability, determine the equalized grayscale value; The equalized grayscale value is applied to each pixel of the denoised initial sonar image to generate the sonar image.

3. The underwater target detection method based on sonar images according to claim 1, characterized in that, The convolutional module includes a first convolutional module, a second convolutional module, a third convolutional module, a fourth convolutional module, a fifth convolutional module, a sixth convolutional module, and a seventh convolutional module; the bottleneck fusion module includes a first bottleneck fusion module, a second bottleneck fusion module, a third bottleneck fusion module, a fourth bottleneck fusion module, and a fifth bottleneck fusion module; the inverted bottleneck fusion module includes a first inverted bottleneck fusion module and a second inverted bottleneck fusion module; the upsampling module includes a first upsampling module and a second upsampling module; and the feature concatenation module includes a first feature concatenation module, a second feature concatenation module, a third feature concatenation module, and a fourth feature concatenation module. The first feature output includes a fifth feature map, a seventh feature map, and an eleventh feature map. The fifth feature map is obtained by inputting the third feature map and the fourth feature map into the second bottleneck fusion module for feature fusion. The seventh feature map is obtained by inputting the fifth feature map and the sixth feature map into the third bottleneck fusion module for feature fusion. The eleventh feature map is obtained by inputting the tenth feature map into the position squeeze attention module for attention mechanism processing. The second feature output includes a sixteenth feature map, a nineteenth feature map, and a twenty-second feature map. The sixteenth feature map is obtained by stitching together the fifteenth and fifth feature maps into the second feature stitching module. The nineteenth feature map is obtained by fusing the features of the eighteenth feature map into the fifth bottleneck fusion module. The twenty-second feature map is obtained by optimizing the features of the twenty-first feature map into the second inverted bottleneck fusion module.

4. The underwater target detection method based on sonar images according to claim 3, characterized in that, The step of inputting the second feature into the output network to obtain the prediction result includes: The sixteenth feature map is input into the first target head module to obtain the location information and category probability distribution of two different first targets. The first target head module includes a first target head sub-module and a second target head module. The nineteenth feature map is input into the second target head module to obtain the location information and category probability distribution of two different second targets. The second target head module includes a third target head sub-module and a fourth target head module. The 22nd feature map is input into the third target head module to obtain the location information and category probability distribution of two different third targets. The third target head module includes a fifth target head sub-module and a sixth target head sub-module.

5. The underwater target detection method based on sonar images according to claim 1, characterized in that, The location information is the target bounding box coordinates, which are expressed in the form of center coordinates, width, and height.

6. The underwater target detection method based on sonar images according to claim 1, characterized in that, The underwater target detection method based on sonar images also includes: Obtain a validation set from the sonar image sample set, input the validation set into the underwater target detection model, and output the validation result corresponding to the sample image in the validation set; The cross-entropy loss function is used to measure the difference between the validation results and the sample labels to guide the underwater target detection model in updating its parameters.

7. An underwater target detection device based on sonar images, characterized in that, The underwater target detection device based on sonar images includes: The first acquisition module is used to acquire a sonar image sample set, which includes sample images and sample labels attached to each sample image. Each sample label includes location information and a category probability distribution. The location information refers to the location information of the underwater target in the sonar image, and the category probability distribution refers to the category probability distribution of the underwater target. The training module is used to acquire a training set in the sonar image sample set and train an initial underwater target detection model using the training set to obtain an underwater target detection model. The initial underwater target detection model is a YOLOv10 network model, which includes an inverted bottleneck fusion module. The inverted bottleneck fusion module integrates an SE block to adaptively adjust the weight of each channel of the sample image during the feature extraction stage. The initial underwater target detection model includes a feature extraction network, a feature fusion network, and an output network. The training set is input into the feature extraction network to obtain the first feature output. The feature extraction network includes at least one convolutional module, at least one bottleneck fusion module, at least one feature concatenation module, a spatial pyramid pooling module, and a positional squeezing attention module. The first feature output is input into the feature fusion network to obtain the second feature output. The feature fusion network includes at least one convolutional module, at least one upsampling module, at least one feature concatenation module, at least one bottleneck fusion module, and at least one inverted bottleneck fusion module. The second feature is input into the output network to obtain the prediction result, which includes the location information and the category probability distribution. The difference between the sample label and the prediction result is compared to adjust the model parameters and obtain the underwater target detection model. The output network includes multiple target detection head modules, each of which contains two target detection head sub-modules. The target detection head modules are used to detect targets of different scales. The bottleneck fusion module includes a fusion strategy, which includes: concatenating the two adjusted feature maps along the channel dimension; performing a linear transformation on the concatenated feature maps using a learnable parameter matrix to obtain a new feature map; passing the new feature map through a Softmax function to obtain an attention map; and weighting the two feature maps using the attention map to obtain a fused feature map. The input module is used to acquire the sonar image to be detected, input the sonar image to be detected into the underwater target detection model, and output the location information and the category probability distribution.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the underwater target detection method based on sonar images according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the underwater target detection method based on sonar images as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Underwater motion biological recognition and evaluation method based on multi-beam image sonar

    CN118298289A

  • Ship remote sensing image detection method based on multi-dimensional attention mechanism

    CN119314064A