Method and system for underwater target sonar image detection region segmentation
By augmenting the sonar dataset and introducing the BoTNet network and SimAm attention mechanism into the YOLOv9 algorithm model, the problems of poor robustness and low accuracy of traditional underwater target sonar image detection methods in complex marine environments are solved, achieving higher detection accuracy and robustness.
Patent Information
- Application Number
- CN202411892609.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2044-12-20
AI Technical Summary
Traditional underwater target sonar image detection methods have poor robustness in complex marine environments, low accuracy in shipwreck detection, and weak ability to capture global dependencies.
Image processing software was used to augment the sonar dataset to construct an experimental dataset. BoTNet network and SimAm attention mechanism were introduced into the improved YOLOv9 algorithm model to enhance feature capture capability and robustness.
The improved YOLOv9 algorithm model enhances the accuracy and robustness of underwater target sonar image detection for shipwrecks, and performs better in complex marine environments with strong feature capture capabilities.
Smart Images

Figure CN119850647B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater sonar detection technology, specifically to a region segmentation method and system for underwater target sonar image detection. Background Technology
[0002] Underwater target detection, identification, and tracking technologies are important research topics with significant applications in both military and civilian fields. Side-scan sonar, as a high-resolution, multi-purpose, and low-cost marine survey device, is widely used in oceans, ports, rivers, lakes, and other water bodies. Traditional applications include hydrographic surveying, underwater engineering site selection, detection of underwater targets such as aircraft wrecks, shipwrecks, torpedoes, mines, containers, chemical drums, anchor chains, sunken rocks, buoys, and navigational obstructions in anchorages, as well as seabed sediment classification, marine surveys, and marine scientific research. While side-scan sonar offers wide coverage and high efficiency in seabed target detection, image interpretation is challenging in complex marine environments. Traditional target identification methods require manual selection of target features, resulting in limited accuracy and robustness, which cannot meet the needs of practical applications. In recent years, the YOLOv9 algorithm has demonstrated superior performance in target detection tasks. However, significant differences exist between side-scan sonar images and natural images. To further improve the accuracy of the YOLOv9 algorithm in shipwreck detection against complex seabed backgrounds, it is necessary to integrate other networks and mechanisms.
[0003] Currently, the robustness of the YOLOv algorithm model used in traditional underwater target sonar image detection methods needs to be improved. It has a weak ability to capture global dependencies in complex underwater environments, resulting in low accuracy in shipwreck detection. Summary of the Invention
[0004] (a) Technical problems to be solved
[0005] To address the shortcomings of existing technologies, this invention provides a region segmentation method and system for underwater target sonar image detection, which has the advantages of strong feature capture capability and high accuracy in shipwreck detection, and solves the problems of poor robustness and low accuracy in traditional underwater target sonar image detection methods.
[0006] (II) Technical Solution
[0007] To achieve the above objectives, the present invention provides the following technical solution: a region segmentation method for underwater target sonar image detection, comprising the following steps:
[0008] Step 1: Collect sonar image data of all areas via a network-connected side-scan sonar and assemble them into a sonar dataset;
[0009] Step 2: Use image processing software to augment the sonar dataset and construct the experimental dataset SY, which includes the training set XL and the validation set YZ.
[0010] Steps: The YOLOv9 algorithm model is set as a real-time object detection framework. Based on the YOLOv9 algorithm model, the BoTNet network is added to the backbone network and the SimAm attention mechanism is introduced into the detection end for optimization and improvement. The improved YOLOv9 algorithm model is used to extract feature information from the experimental dataset SY.
[0011] Step 4: Based on the experimental dataset SY, compare the detection accuracy of the improved YOLOv9 algorithm model with that of the YOLOv3, YOLOv5, YOLOv7, and YOLOv9 algorithm models. Calculate the mean accuracy (AP) and F1 score for each algorithm model. If the mean accuracy (AP) and F1 score of the improved YOLOv9 algorithm model are both greater than or equal to the mean accuracy (AP) and F1 score of the other algorithm models, it indicates that the improved YOLOv9 algorithm model has high detection accuracy.
[0012] A region segmentation system for underwater target sonar image detection, comprising an image acquisition module, an algorithm optimization module, and a verification and evaluation module;
[0013] The image acquisition module acquires a sonar dataset via a network connection to a side-scan sonar. The sonar dataset includes sonar image data from all regions. The image acquisition module uses image processing software to perform data augmentation on the sonar dataset and constructs an experimental dataset SY. The experimental dataset SY includes a training set XL and a validation set YZ, which are used for deep learning and validation evaluation of the algorithm model.
[0014] The algorithm optimization module sets the YOLOv9 algorithm model as a real-time object detection framework. Based on the YOLOv9 algorithm model, the BoTNet network is added to the backbone network and the SimAm attention mechanism is introduced into the detection end for optimization and improvement. The improved YOLOv9 algorithm model is used to extract feature information from the experimental dataset SY.
[0015] The verification and evaluation module compares the detection accuracy of the improved YOLOv9 algorithm model with that of the YOLOv3, YOLOv5, YOLOv7, and YOLOv9 algorithm models based on the experimental dataset SY. It calculates the mean accuracy (AP) and F1 score for each algorithm model. If the mean accuracy (AP) and F1 score of the improved YOLOv9 algorithm model are both greater than or equal to the mean accuracy (AP) and F1 score of the other algorithm models, it indicates that the improved YOLOv9 algorithm model has high detection accuracy.
[0016] Compared with existing technologies, the present invention provides a region segmentation method and system for underwater target sonar image detection, which has the following beneficial effects:
[0017] 1. This invention acquires a sonar dataset via a network connection between an image acquisition module and a side-scan sonar. The sonar dataset includes sonar image data from all regions. The image acquisition module uses image processing software to augment the sonar dataset and constructs an experimental dataset SY, specifically magnifying image details to improve the detection accuracy of shipwrecks. This helps improve the robustness of the algorithm model and reduces the model's sensitivity to images. The algorithm optimization module sets the YOLOv9 algorithm model as a real-time target detection framework. Based on the YOLOv9 algorithm model, it adds the BoTNet network to the backbone network and introduces the SimAM attention mechanism into the detection end for optimization and improvement. The BoTNet network utilizes relative position encoding to sensitively perceive the spatial relationship between feature information. The SimAM attention mechanism can efficiently calculate 3D attention weights and apply them to the feature map for weighting, improving the detection performance of the YOLOv9 algorithm model when processing visual tasks. The model is more robust, more adaptable to complex marine environments, and has strong feature capture capabilities.
[0018] 2. This invention uses a verification and evaluation module to calculate the mean accuracy (AP) and F1 score of each algorithm model based on the experimental dataset SY. The detection accuracy of the improved YOLOv9 algorithm model is compared with that of the YOLOv3, YOLOv5, YOLOv7, and YOLOv9 algorithm models. If the mean accuracy (AP) and F1 score of the improved YOLOv9 algorithm model are both greater than or equal to the mean accuracy (AP) and F1 score of the other algorithm models, it indicates that the improved YOLOv9 algorithm model has high accuracy in detecting shipwrecks. Attached Figure Description
[0019] Figure 1 This is a diagram illustrating the steps of the method of the present invention;
[0020] Figure 2 This is a structural diagram of the basic YOLOv9 algorithm model of the system of this invention;
[0021] Figure 3 This is a structural diagram of the improved YOLOv9 algorithm model of the present invention;
[0022] Figure 4 This is a schematic diagram of the multi-head attention layer of the SimAm attention mechanism in the system of the present invention;
[0023] Figure 5 This is a flowchart of the system structure of the present invention. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] Because the robustness of the YOLOv algorithm model used in traditional underwater target sonar image detection methods needs improvement, and its ability to capture global dependencies is weak in complex underwater environments, resulting in low accuracy in shipwreck detection, this paper presents a region segmentation method and system for underwater target sonar image detection. Please refer to [link to relevant documentation]. Figure 1 A region segmentation method for underwater target sonar image detection includes the following steps:
[0026] Step 1: Collect sonar image data of all areas via a network-connected side-scan sonar and assemble them into a sonar dataset;
[0027] The expression for the sonar dataset is {S1} q S2 q S3 q ... Sn q}, S1 q To Sn q These are the sonar image data for the first to the nth regions, where q represents the region number. Collecting sonar images of the underwater environment according to the region is beneficial for quickly determining the location and depth of the sunken ship target.
[0028] Step 2: Use image processing software to augment the sonar dataset and construct the experimental dataset SY. The experimental dataset SY includes the training set XL and the validation set YZ. The construction process is as follows:
[0029] Extract the sonar image data of the i-th region from the sonar dataset and label it as Si. q ;
[0030] Using image processing software, Si q Data augmentation, including rotation, noise addition, cropping, translation, and brightness adjustment, helps improve the robustness of the algorithm model and reduce its sensitivity to images.
[0031]
[0032]
[0033] In the formula, SY represents the experimental dataset, and 4Si q This indicates the use of image processing software to process Si qThe number of images in the data has been increased to four times the original number. This indicates that image processing software was used to expand the number of sonar images for all regions in the sonar dataset to four times the original number. This indicates that the experimental dataset is divided into a training set XL and a validation set YZ in a 4:1 ratio. The acquisition cost of underwater acoustic images is high, and the number of side-scan sonar images acquired is relatively small. It is necessary to specifically magnify the image details to improve the detection accuracy of shipwrecks.
[0034] Step 3: Set the YOLOv9 algorithm model as a real-time object detection framework, and based on the YOLOv9 algorithm model, add the BoTNet network to the backbone network and S... The imAm attention mechanism was introduced into the detection stage for optimization and improvement. While the traditional YOLOv9 algorithm model performs well in capturing local features, it often requires stacking a large number of layers to model the global context, resulting in excessively long detection times. The addition of the BoTNet network retains the overall ResNet framework and replaces the spatial convolutional branches in the last three bottleneck blocks of the ResNet architecture with multi-head self-attention layers. This replacement transforms these bottleneck blocks into a Transformer-like structure, improving the network's ability to capture global dependencies without significantly increasing computational burden. Due to the small number of scanned sonar images, the SimAm attention mechanism infers 3D attention weights, considering both channel and spatial dimensions. It can enhance the features of shipwreck targets in side-scan sonar without increasing the parameters of the original network, sensitively perceiving the spatial relationships between features, and further improving the performance of visual tasks. The improved YOLOv9 algorithm model was used to extract feature information from the experimental dataset SY. The improved YOLOv9 algorithm model has good recognition and detection performance for side-scan sonar images with low resolution, high noise, and few target features, and has better robustness for shipwreck detection under different seabed backgrounds.
[0035] Please see Figures 2-3 The YOLOv9 algorithm model consists of a backbone network and multiple branch networks. The network structure includes convolutional layers, convolutional blocks, a feature pyramid network, and an output network. It is used to extract feature information from sonar images in the experimental dataset SY. Each convolutional layer and convolutional block performs the first extraction on the sonar image, aiming to effectively extract low-level features. The feature pyramid network then fuses the feature information from different convolutional layers and convolutional blocks for the second extraction, aiming to effectively extract high-level features. The output network predicts the type, confidence level, and location of the target based on the feature information extracted in the two extractions.
[0036] Please see Figure 4The BoTNet network employs a multi-head attention mechanism and a broadcasting mechanism to enhance the feature capture capabilities of the YOLOv9 algorithm model in image classification, object detection, and instance segmentation without significantly increasing computational burden. The multi-head attention mechanism includes multiple parallel attention heads, each processing a different sonar image independently, enabling the YOLOv9 algorithm model to capture diverse patterns and relationships in the data. The input size of the multi-head attention mechanism is H×W×d, where H represents the height of the input feature matrix, W represents the width of the input feature matrix, and d represents the dimension of the input feature matrix. The BoTNet network has two initialization parameter vectors R. h and R w R h Represents the height location code, R w The width positional encoding is represented by a broadcast mechanism to calculate the sum of query q, key k, positional encoding r, and value V. Then, matrix multiplication is used to calculate the positional encoding and query encoding to obtain part one of the self-attention. Matrix multiplication is used to calculate the query encoding and key encoding to obtain part two of the self-attention. After adding part one and part two of the self-attention, the results are processed by the softmax function to finally obtain the complete self-attention weights. The BoTNet network utilizes relative positional encoding to sensitively perceive the spatial relationship between feature information, further improving the detection performance of the YOLOv9 algorithm model when processing visual tasks.
[0037] The SimAM attention mechanism transcends channel and spatial dimensions, directly inferring 3D attention weights without increasing the parameters of the original network. Side-scan sonar images have low resolution, high noise, and few target features. Introducing the SimAM attention mechanism can better identify and optimize the feature information of shipwreck targets in side-scan sonar. The SimAM attention mechanism has an energy function to find the importance of each neuron, and its calculation process is as follows:
[0038]
[0039] M = H × W
[0040] In the formula, t represents the target neuron, and x i Other neurons in the same channel are represented by M = H × W, which represents the height H of the sonar image multiplied by the width W, i.e., the area M of the input image. ω t b represents the weight variable. t λ represents the offset variable, and λ represents the hyperparameter.
[0041] By taking the partial derivative of the energy function with respect to the variable and substituting it into the antiderivative, we can obtain e. t Analysis of the minimum value:
[0042]
[0043]
[0044]
[0045] The lower the energy, the greater the difference between the target neuron (t) and surrounding neurons; the importance of each neuron can be determined by... get;
[0046] The refined expression for the SimAM attention mechanism is as follows:
[0047]
[0048] In the formula, E represents the totality across both channel and spatial dimensions. Grouping is performed, sigmoid represents a single-order function, sigmoid restricts the large values in e to avoid affecting the relative importance of each neuron, X represents all neurons in the same channel, SimAM attention mechanism can efficiently calculate 3D attention weights and apply them to feature maps for weighting, the model is more robust, more adaptable to complex marine environments, and has strong feature capture ability.
[0049] Step 4: Substitute the training set XL into the improved YOLOv9, YOLOv3, YOLOv5, YOLOv7, and YOLOv9 algorithm models for deep learning. Then, substitute the validation set YZ into the improved YOLOv9, YOLOv3, YOLOv5, YOLOv7, and YOLOv9 algorithm models for object detection. Based on the object detection results of each algorithm model, calculate the precision P, recall R, mean precision AP, and F1 score to digitally evaluate the detection performance of the algorithm models in different tasks. The calculation formulas are as follows:
[0050]
[0051] In the formula, TP represents true positives, which is the number of samples correctly predicted as positive by a single algorithm model; FP represents false positives, which is the number of samples incorrectly predicted as positive by a single algorithm model; and precision P is the proportion of instances that the model predicts as positive but are actually positive. A high precision means that the model is more accurate in predicting positive samples.
[0052]
[0053] In the formula, FN represents false negatives, which is the number of samples that a single algorithm model fails to correctly predict as positive. The mean precision (AP) and F1 score of each algorithm model are calculated. The recall (R) is the proportion of all instances that are actually positive that are correctly predicted as positive by the model. A high recall means that the model can identify most of the positive samples and has a low false negative rate.
[0054]
[0055] In the formula, The integral formula is used to calculate the area under the precision-recall curve, which is the average precision (AP) of a single algorithm model. The mean precision (AP) is used to measure the detection precision of the model under different thresholds. It comprehensively considers the performance of the model under various detection thresholds. Since only one type of shipwreck target is detected, the upper limit of the above integral formula is 1.
[0056]
[0057] In the formula, The harmonic mean of precision P and recall R represents the F1 score of a single algorithm model.
[0058] Based on the experimental dataset SY, the detection accuracy of the improved YOLOv9 algorithm model is compared with that of the YOLOv3, YOLOv5, YOLOv7, and YOLOv9 algorithm models. If the mean accuracy (AP) and F1 score of the improved YOLOv9 algorithm model are both greater than or equal to the mean accuracy (AP) and F1 score of the other algorithm models, it indicates that the improved YOLOv9 algorithm model has high shipwreck detection accuracy.
[0059] Please see Figure 5 A region segmentation system for underwater target sonar image detection, including an image acquisition module, an algorithm optimization module, and a verification and evaluation module;
[0060] The image acquisition module acquires a sonar dataset via a network connection to a side-scan sonar. The sonar dataset includes sonar image data from all areas. The image acquisition module uses image processing software to augment the sonar dataset and construct an experimental dataset SY. The experimental dataset SY includes a training set XL and a validation set YZ, which are used for deep learning and validation evaluation of the algorithm model.
[0061] The algorithm optimization module sets the YOLOv9 algorithm model as a real-time object detection framework. Based on the YOLOv9 algorithm model, the BoTNet network is added to the backbone network and the SimAm attention mechanism is introduced to the detection end for optimization and improvement. The improved YOLOv9 algorithm model is used to extract feature information from the experimental dataset SY, and has strong feature capture ability.
[0062] The validation and evaluation module compares the detection accuracy of the improved YOLOv9 algorithm model with that of the YOLOv3, YOLOv5, YOLOv7, and YOLOv9 algorithm models based on the experimental dataset SY. It calculates the mean accuracy (AP) and F1 score for each algorithm model. If the mean AP and F1 score of the improved YOLOv9 algorithm model are both greater than or equal to the mean AP and F1 scores of the other algorithm models, it indicates that the improved YOLOv9 algorithm model has high detection accuracy. Specific experimental data is shown in the table below:
[0063]
[0064]
[0065] Experimental results show that, compared with the four models YOLOv3, YOLOv5, YOLOv7, and YOLOv9, the improved YOLOv9 model improves mAP@0.5 by 3.8%, 6%, 14.2%, and 2.6%, respectively, and the mAP@0.5:0.95 improves by 16.8%, 10.9%, 16.6%, and 1.1%, respectively. The improved YOLOv9 model has the highest detection accuracy.
[0066] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A region segmentation method for underwater target sonar image detection, characterized in that, Includes the following steps: Step 1: Collect sonar image data of all areas via a network-connected side-scan sonar and assemble them into a sonar dataset; Step 2: Use image processing software to augment the sonar dataset and construct the experimental dataset. Experimental dataset Including training set and verification set ; Step 3: Set the YOLOv9 algorithm model as a real-time object detection framework. Based on the YOLOv9 algorithm model, add the BoTNet network to the backbone network and introduce the SimAm attention mechanism into the detection end for optimization and improvement. The improved YOLOv9 algorithm model is used to extract experimental datasets. Feature information in; In step three, the YOLOv9 algorithm model's network structure consists of a backbone network and multiple branch networks. The network structure includes convolutional layers, convolutional blocks, a feature pyramid network, and an output network, used to extract the experimental dataset. The feature pyramid network extracts the feature information of the sonar image. Each convolutional layer and convolutional block extracts the feature information of the sonar image for the first time. Then, the feature pyramid network fuses the feature information from different convolutional layers and convolutional blocks for the second extraction. The output network predicts the type, confidence level and location of the target based on the feature information extracted in the two extractions. The BoTNet network employs a multi-head attention mechanism and a broadcast mechanism. The multi-head attention mechanism involves multiple parallel attention heads, each processing a different sonar image independently. The input size of the multi-head attention mechanism is... , This represents the height of the input feature matrix. This represents the width of the input feature matrix. The BoTNet network has two initialization parameter vectors, representing the dimension of the input feature matrix. and , Indicates height location encoding, Indicates width position encoding; Query calculated using broadcast mechanism Key Location coding Sum The sum of the values is then used to calculate the position code and query code using matrix multiplication to obtain part one of the self-attention. The query code and key code are then calculated using matrix multiplication to obtain part two of the self-attention. Part one and part two of the self-attention are added together and then processed by the softmax function to finally obtain the complete self-attention weights. In step three, the SimAM attention mechanism is equipped with an energy function to find the importance of each neuron; By taking the partial derivative of the energy function with respect to the variables and substituting it into the antiderivative, we can obtain the following: Analysis of the minimum value; The lower the energy, the more effective the target neuron. The greater the difference from surrounding neurons, the more important each neuron can be calculated; Step 4: Based on the experimental dataset The detection accuracy of the improved YOLOv9 algorithm model was compared with that of the YOLOv3, YOLOv5, YOLOv7, and YOLOv9 algorithm models, and the mean accuracy of each algorithm model was calculated. and The score, if the average accuracy of the improved YOLOv9 algorithm model is... and The scores are all greater than or equal to the mean accuracy of other algorithm models. and The score indicates that the improved YOLOv9 algorithm model has high detection accuracy.
2. The region segmentation method for underwater target sonar image detection according to claim 1, characterized in that: In step one, the expression for the sonar dataset is: , to They are respectively the first to the second Sonar image data for each region Indicates the area code.
3. The region segmentation method for underwater target sonar image detection according to claim 1, characterized in that: In step two, the experimental dataset The build process is as follows: Extracting the first from the sonar dataset Sonar image data for each region, and labeled as ; Using image processing software, Perform data augmentation, including rotation, adding noise, cropping, translation, and adjusting brightness.
4. The region segmentation method for underwater target sonar image detection according to claim 1, characterized in that: In step four, the training set Substitute the improved YOLOv9, YOLOv3, YOLOv5, YOLOv7, and YOLOv9 algorithm models into the deep learning dataset, and then perform deep learning on the validation set. Substitute the improved YOLOv9, YOLOv3, YOLOv5, YOLOv7, and YOLOv9 algorithm models into the target detection process, and calculate the accuracy based on the target detection results of each algorithm model. and recall rate .
5. A region segmentation system for underwater target sonar image detection, applied to the region segmentation method for underwater target sonar image detection according to any one of claims 1-4, characterized in that: It includes an image acquisition module, an algorithm optimization module, and a verification and evaluation module; The image acquisition module acquires a sonar dataset via a network connection to a side-scan sonar system. This sonar dataset includes sonar image data from all areas. The image acquisition module then uses image processing software to augment the sonar dataset and construct an experimental dataset. The experimental dataset Including training set and verification set It is used for deep learning and validation evaluation of algorithm models; The algorithm optimization module sets the YOLOv9 algorithm model as a real-time object detection framework. Based on the YOLOv9 algorithm model, it adds the BoTNet network to the backbone network and introduces the SimAm attention mechanism into the detection end for optimization and improvement. The improved YOLOv9 algorithm model is used to extract experimental datasets. Feature information in; The verification and evaluation module is based on the experimental dataset. The detection accuracy of the improved YOLOv9 algorithm model was compared with that of the YOLOv3, YOLOv5, YOLOv7, and YOLOv9 algorithm models, and the mean accuracy of each algorithm model was calculated. and The score, if the average accuracy of the improved YOLOv9 algorithm model is... and The scores are all greater than or equal to the mean accuracy of other algorithm models. and The score indicates that the improved YOLOv9 algorithm model has high detection accuracy.
Citation Information
Patent Citations
Pesticide application method of visual spraying robot based on augmented reality remote control
CN118202987A
Underwater target detection method and system based on enhanced YOLOv9 model
CN118587569A