Region segmentation method and system for underwater target sonar image detection
By adding the BoTNet network and SimAm attention mechanism to the traditional underwater target sonar image detection method, the YOLOv9 algorithm model is optimized, and the problems of poor robustness of the traditional method and low shipwreck detection accuracy are solved, achieving higher detection accuracy and ability to adapt to complex marine environments.
Patent Information
- Application Number
- CN202411892609.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The traditional underwater target sonar image detection method has poor robustness and low shipwreck detection accuracy, making it difficult to meet the needs of complex sea environments.
Scan the sonar on the side through the network connection to collect the sonar image data, use image processing software to enhance the data, and build an experimental data set. The BoTNet network is added to the backbone network of the YOLOv9 algorithm model, and the SimAm attention mechanism is introduced to optimize and improve the YOLOv9 algorithm model to improve feature capture capabilities and detection accuracy.
The robustness and shipwreck detection accuracy of the YOLOv9 algorithm model are improved, and the model's adaptability in complex marine environments is enhanced, with strong feature capture capabilities and improved detection performance.
Smart Images

Figure CN119850647A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of underwater sonar detection, and in particular to a method and system for regional segmentation of underwater target sonar image detection. Background Art
[0002] Underwater target detection, recognition and tracking technology is a hot research topic with great significance and has important applications in both military and civilian fields. As a high-resolution, multi-purpose and low-cost marine survey equipment, side-scan sonar is widely used in oceans, ports, rivers, lakes and other waters. Traditional applications include hydrographic survey, underwater engineering site selection, detection of underwater targets such as aircraft wreckage, shipwrecks, torpedoes, mines, containers, chemical barrels, anchor chains, sunken stones, buoys, anchorage obstacles, as well as seabed classification, marine surveys and marine scientific research. Side-scan sonar has a wide coverage width and high work efficiency for seabed target detection, but in complex sea environments, image interpretation is difficult. Traditional target recognition methods require manual optimization of target features, and the accuracy and robustness in detection are limited, making it difficult to meet the needs of practical applications. In recent years, the YOLOv9 algorithm has shown excellent performance in target detection tasks. However, there are significant differences between side-scan sonar images and natural images. In order to further improve the accuracy of YOLOv9 algorithm in shipwreck detection under complex seabed backgrounds, other networks and mechanisms need to be integrated.
[0003] At present, the robustness of the YOLOv algorithm model used in the traditional underwater target sonar image detection method needs to be improved. Faced with complex underwater environments, its ability to capture global dependencies is weak and the accuracy of shipwreck detection is low. Summary of the invention
[0004] 1. Technical issues to be solved
[0005] In view of the shortcomings of the prior art, the present invention provides a regional segmentation method and system for underwater target sonar image detection, which has the advantages of strong feature capture capability and high shipwreck detection accuracy, and solves the problems of poor robustness and low shipwreck detection accuracy of traditional underwater target sonar image detection methods.
[0006] (II) Technical solution
[0007] To achieve the above object, the present invention provides the following technical solution: a method for regional segmentation of underwater target sonar image detection, comprising the following steps:
[0008] Step 1: Collect sonar image data of all areas through network connection side scan sonar and form a sonar data set;
[0009] Step 2: Use image processing software to enhance the sonar data set and construct an experimental data set SY, which includes a training set XL and a validation set YZ;
[0010] Steps: Set the YOLOv9 algorithm model as the real-time target detection framework, and 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 feature information from the experimental data set SY;
[0011] Step 4: According to the experimental data set SY, compare the detection accuracy of the improved YOLOv9 algorithm model with the YOLOv3 algorithm model, YOLOv5 algorithm model, YOLOv7 algorithm model and YOLOv9 algorithm model, and calculate the average precision AP and F1 score of each algorithm model. If the average precision AP and F1 score of the improved YOLOv9 algorithm model are greater than or equal to the average precision AP and F1 scores of other algorithm models, it means that the detection accuracy of the improved YOLOv9 algorithm model is high.
[0012] The regional segmentation system for underwater target sonar image detection includes an image acquisition module, an algorithm optimization module, and a verification and evaluation module;
[0013] The image acquisition module collects a sonar data set through a network connection to a side-scan sonar, and the sonar data set includes sonar image data of all areas. The image acquisition module uses image processing software to perform data enhancement on the sonar data set and construct an experimental data set SY, and the experimental data set SY includes a training set XL and a verification set YZ, which are used for deep learning and verification evaluation of the algorithm model;
[0014] The algorithm optimization module sets the YOLOv9 algorithm model as a real-time target detection framework, and based on the YOLOv9 algorithm model, 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 feature information in the experimental data set SY;
[0015] The verification and evaluation module compares the detection accuracy of the improved YOLOv9 algorithm model with the YOLOv3 algorithm model, the YOLOv5 algorithm model, the YOLOv7 algorithm model and the YOLOv9 algorithm model according to the experimental data set SY, and calculates the average precision mean AP and the F1 score of each algorithm model. If the average precision mean AP and the F1 score of the improved YOLOv9 algorithm model are greater than or equal to the average precision mean AP and the F1 score of other algorithm models, it means that the detection accuracy of the improved YOLOv9 algorithm model is high.
[0016] Compared with the prior art, the present invention provides a method and system for regional segmentation of underwater target sonar image detection, which has the following beneficial effects:
[0017] 1. The present invention collects sonar data sets by connecting the side-scan sonar to the image acquisition module network. The sonar data sets include sonar image data of all areas. The image acquisition module uses image processing software to perform data enhancement on the sonar data set, and constructs an experimental data set SY, which specifically amplifies image details and improves the detection accuracy of shipwrecks, helps to improve the robustness of the algorithm model, and reduces the sensitivity of the model to images. The algorithm optimization module sets the YOLOv9 algorithm model as a real-time target detection framework, and based on the YOLOv9 algorithm model, adds the BoTNet network to the backbone network and introduces the SimAm attention mechanism to the detection end for optimization and improvement. The BoTNet network utilizes relative position encoding and is sensitive to the spatial relationship between feature information. The SimAM attention mechanism can efficiently calculate the 3D attention weight and apply it to the feature map for weighting, thereby 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. The present invention calculates the average precision mean AP and F1 score of each algorithm model according to the experimental data set SY through the verification and evaluation module, and compares the detection accuracy of the improved YOLOv9 algorithm model with the YOLOv3 algorithm model, the YOLOv5 algorithm model, the YOLOv7 algorithm model and the YOLOv9 algorithm model. If the average precision mean AP and F1 score of the improved YOLOv9 algorithm model are greater than or equal to the average precision mean AP and F1 scores of other algorithm models, it means that the improved YOLOv9 algorithm model has high shipwreck detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a step diagram of the method of the present invention;
[0020] Figure 2 This is a structural diagram of the YOLOv9 algorithm model based on the system of the present invention;
[0021] Figure 3 This is a structural diagram of the YOLOv9 algorithm model after the improvement of the system of the present invention;
[0022] Figure 4 Schematic diagram of the multi-head attention layer of the SimAm attention mechanism of the system of the present invention;
[0023] Figure 5 It is a flow chart of the system of the present invention. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] Since the robustness of the YOLOv algorithm model used in the traditional underwater target sonar image detection method needs to be improved, the ability to capture global dependencies is weak in the face of complex underwater environments, and the accuracy of shipwreck detection is low, therefore, a regional segmentation method and system for underwater target sonar image detection is provided. Figure 1 , a regional segmentation method for underwater target sonar image detection, comprising the following steps:
[0026] Step 1: Collect sonar image data of all areas through network connection side scan sonar and form a sonar data set;
[0027] The expression of the sonar dataset is {S1 q 、S2 q 、S3 q 、...、Sn q},S1 q To Sn q They are the sonar image data of the first to nth areas, respectively. q represents the area number. Collecting sonar images in the underwater environment according to the area is conducive to the subsequent rapid determination of the location and depth of the sunken ship target.
[0028] Step 2: Use image processing software to enhance 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 area in the sonar dataset and mark it as Si q ;
[0030] Using image processing software, Si q Performing data enhancement, including rotation, adding noise, cropping, translation, and adjusting brightness, helps improve the robustness of the algorithm model and reduce the model's sensitivity to images;
[0031]
[0032]
[0033] In the formula, SY represents the experimental data set, 4Si q Indicates that the image processing software is used to qThe number of images in the data is expanded to 4 times of the original data. This means that the number of sonar images in all areas of the sonar dataset is expanded to four times the original data using image processing software. It indicates that the experimental data set is divided into a training set XL and a validation set YZ in a ratio of 4:1. The acquisition cost of underwater acoustic images is high, and the collected side-scan sonar images are few. It is necessary to specifically amplify the image details to improve the detection accuracy of the sunken ship;
[0034] Step 3: Set the YOLOv9 algorithm model as a real-time target detection framework, and add the BoTNet network to the backbone network and S The imAm attention mechanism is introduced into the detection end for optimization and improvement. Although 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, which leads to a long detection time. The addition of the BoTNet network retains the overall ResNet framework and replaces the spatial convolution branches in the last three bottleneck blocks in the ResNet architecture with multi-head self-attention layers. This replacement transforms these bottleneck blocks into a Transformer-like structure, which improves the network's ability to capture global dependencies without significantly increasing the computational burden. Due to the small number of scanning sonar images, the SimAm attention mechanism infers 3D attention weights, which is compatible with considering channels and spatial dimensions. It does not need to increase the parameters of the original network, and can enhance the features of shipwreck targets in side-scan sonar. It can sensitively perceive the spatial relationship between features, further improving the performance of visual tasks. The improved YOLOv9 algorithm model is used to extract feature information from the experimental data set SY. The improved YOLOv9 algorithm model has good recognition and detection effects 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] See also Figure 2-Figure 3 The network structure of the YOLOv9 algorithm model consists of a backbone network and multiple branch networks. The network structure includes convolutional layers, convolutional blocks, feature pyramid networks and output networks, which are used to extract the feature information of sonar images in the experimental data set 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 in different convolutional layers and convolutional blocks for the second extraction, aiming to effectively extract high-level features. The output network predicts the type, confidence and position of the target based on the feature information extracted twice;
[0036] See also Figure 4The BoTNet network is equipped with a multi-head attention mechanism and a broadcast mechanism to enhance the feature capture capability of the YOLOv9 algorithm model in image classification, target detection, and instance segmentation without significantly increasing the computational burden. The multi-head attention mechanism contains multiple parallel attention heads, and each attention head processes different sonar images separately, 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 is equipped with two initialization parameter vectors R h and R w , R h Represents the height position encoding, R w Represents the width position encoding, calculates the sum of query q, key k, position encoding r and value V through the broadcast mechanism, and then uses matrix multiplication to calculate the position encoding and query encoding to obtain part 1 of self-attention Attention, uses matrix multiplication to calculate the query encoding and key encoding to obtain part 2 of self-attention Attention, adds part 1 and part 2 of self-attention Attention, and processes them through the softmax function to finally obtain the complete self-attention Attention weight. The BoTNet network uses relative position 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 spans channels and spatial dimensions, directly infers 3D attention weights, and does not need to increase the parameters of the original network. Side-scan sonar images have low resolution, high noise, and few target features. By introducing the SimAm attention mechanism, the feature information of shipwreck targets in side-scan sonar can be better identified and optimized. The SimAM attention mechanism is set with an energy function to find the importance of each neuron. The calculation process is as follows:
[0038]
[0039] M=H×W
[0040] In the formula, t represents the target neuron, x i represents other neurons in the same channel, M = H × W represents the height H of the sonar image multiplied by the width W, which is the area M of the input image, ω t represents the weight variable, b t represents the offset variable, and λ represents the hyperparameter;
[0041] Taking the partial derivative of the energy function variable and substituting it into the original function, we can get 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 the surrounding neurons. The importance of each neuron can be measured by get;
[0046] The detailed expression of SimAM attention mechanism is:
[0047]
[0048] In the formula, E represents all the The sigmoid function is used to group the neurons. The sigmoid function limits the larger values in e to avoid affecting the relative importance of each neuron. X represents all neurons in the same channel. The SimAM attention mechanism can efficiently calculate the 3D attention weights and apply them to the feature maps for weighting. The model is more robust, more adaptable to complex marine environments, and has strong feature capture capabilities.
[0049] Step 4: Substitute the training set XL into the improved YOLOv9 algorithm model, YOLOv3 algorithm model, YOLOv5 algorithm model, YOLOv7 algorithm model and YOLOv9 algorithm model for deep learning, and then substitute the verification set YZ into the improved YOLOv9 algorithm model, YOLOv3 algorithm model, YOLOv5 algorithm model, YOLOv7 algorithm model and YOLOv9 algorithm model for target detection. According to the target detection results of each algorithm model, calculate the precision P, recall rate R, average precision AP and F1 score, and digitally evaluate the detection performance of the algorithm model in different tasks. The calculation formula is as follows:
[0050]
[0051] In the formula, TP represents true positive examples, that is, the number of samples correctly predicted as positive by a single algorithm model; FP represents false positive examples, that is, the number of samples incorrectly predicted as positive by a single algorithm model; precision P refers to the proportion of samples that are actually positive among the samples predicted as positive by the model. A high precision means that the model is more accurate in predicting positive samples.
[0052]
[0053] In the formula, FN represents false negative examples, that is, the number of samples that a single algorithm model fails to correctly predict as positive samples. The average precision AP and F1 score of each algorithm model are calculated. The recall rate R refers to the proportion of all instances that are actually positive samples that are correctly predicted as positive samples by the model. A high recall rate means that the model can identify most positive samples and has a low false negative rate.
[0054]
[0055] In the formula, It means that the area under the detection precision-recall curve is obtained through the integral calculation formula, which is the average precision AP of a single algorithm model. The average precision AP is used to measure the detection accuracy of the model under different thresholds, and comprehensively considers the performance of the model under various detection thresholds. Because only one type of shipwreck target is detected, the upper limit of the above integral calculation formula is 1;
[0056]
[0057] In the formula, It represents the harmonic mean of precision P and recall R, which is the F1 score of a single algorithm model;
[0058] According to the experimental data set SY, the detection accuracy of the improved YOLOv9 algorithm model is compared with the YOLOv3 algorithm model, YOLOv5 algorithm model, YOLOv7 algorithm model and YOLOv9 algorithm model. If the average precision mean AP and F1 score of the improved YOLOv9 algorithm model are greater than or equal to the average precision mean AP and F1 scores of other algorithm models, it means that the improved YOLOv9 algorithm model has high shipwreck detection accuracy.
[0059] See also Figure 5 , the regional segmentation system for underwater target sonar image detection, including image acquisition module, algorithm optimization module and verification and evaluation module;
[0060] The image acquisition module collects sonar data sets through a network connection to the side-scan sonar. The sonar data sets include sonar image data of all areas. The image acquisition module uses image processing software to perform data enhancement on the sonar data sets and construct an experimental data set SY. The experimental data set 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 target detection framework, and based on the YOLOv9 algorithm model, 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 feature information from the experimental data set SY, and has strong feature capture capabilities;
[0062] The verification and evaluation module compares the detection accuracy of the improved YOLOv9 algorithm model with the YOLOv3 algorithm model, the YOLOv5 algorithm model, the YOLOv7 algorithm model and the YOLOv9 algorithm model based on the experimental data set SY, and calculates the average precision mean AP and F1 score of each algorithm model. If the average precision mean AP and F1 score of the improved YOLOv9 algorithm model are greater than or equal to the average precision mean AP and F1 score of other algorithm models, it means that the detection accuracy of the improved YOLOv9 algorithm model is high. Specifically, the experimental data is as follows:
[0063]
[0064]
[0065] Experimental results show that the improved YOLOv9 model has improved mAP@0.5 by 3.8%, 6%, 14.2% and 2.6% respectively compared with YOLOv3, YOLOv5, YOLOv7 and YOLOv9 models, and mAP@0.5:0.95 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 present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A regional segmentation method for underwater target sonar image detection, characterized in that: The following steps are involved: Step 1: Collect sonar image data of all areas through network connection side scan sonar and form a sonar data set; Step 2: Use image processing software to enhance the sonar data set and construct an experimental data set SY, which includes a training set XL and a validation set YZ; Step 3: Set the YOLOv9 algorithm model as the real-time target detection framework, and 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 feature information from the experimental data set SY; Step 4: According to the experimental data set SY, compare the detection accuracy of the improved YOLOv9 algorithm model with the YOLOv3 algorithm model, YOLOv5 algorithm model, YOLOv7 algorithm model and YOLOv9 algorithm model, and calculate the average precision AP and F1 score of each algorithm model. If the average precision AP and F1 score of the improved YOLOv9 algorithm model are greater than or equal to the average precision AP and F1 scores of other algorithm models, it means that the detection accuracy of the improved YOLOv9 algorithm model is high.
2. The method for regional segmentation of underwater target sonar image detection according to claim 1, characterized in that: In step 1, the expression of the sonar data set is {S1 q 、S2 q 、S3 q 、...、Sn q },S1 q To Sn q They are the sonar image data of the first to nth areas respectively, and q represents the area number.
3. The method for regional segmentation of underwater target sonar image detection according to claim 2, characterized in that: In step 2, the construction process of the experimental data set SY is as follows: Extract the sonar image data of the i-th area in the sonar dataset and mark it as Siq; Image processing software is used to perform data enhancement on Siq, including rotation, adding noise, cropping, translation, and adjusting brightness.
4. The method for regional segmentation of underwater target sonar image detection according to claim 3, characterized in that: In the step three, the network structure of the YOLOv9 algorithm model consists of a trunk network and multiple branch networks. The network structure includes convolutional layers, convolutional blocks, feature pyramid networks and output networks, which are used to extract feature information of sonar images in the experimental data set SY. Each convolutional layer and convolutional block performs a first extraction on the sonar image, and the feature pyramid network then fuses the feature information in different convolutional layers and convolutional blocks for a second extraction. The output network predicts the type, confidence and position of the target based on the feature information extracted twice.
5. The method for regional segmentation of underwater target sonar image detection according to claim 4, characterized in that: In step 3, the BoTNet network is configured with a multi-head attention mechanism and a broadcast mechanism. The multi-head attention mechanism includes multiple parallel attention heads, and each attention head processes different sonar images separately. 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 is configured with two initialization parameter vectors R h and R w , R h Represents the height position encoding, R w Represents width position encoding.
6. The method for regional segmentation of underwater target sonar image detection according to claim 5, characterized in that: The sum of the query q, key k, position code r and value V is calculated through the broadcast mechanism, and then the position code and query code are calculated by matrix multiplication to obtain part one of the self-attention Attention. The query code and key code are calculated by matrix multiplication to obtain part two of the self-attention Attention. After adding part one and part two of the self-attention Attention, they are processed by the softmax function to finally obtain the complete self-attention Attention weight.
7. The method for regional segmentation of underwater target sonar image detection according to claim 6, characterized in that: In step 3, the SimAM attention mechanism is set with an energy function to find the importance of each neuron; Taking the partial derivative of the energy function variable and substituting it into the original function, we can get e t Analysis of minimum values; The lower the energy, the greater the difference between the target neuron t and the surrounding neurons, and the importance of each neuron can be calculated.
8. The method for regional segmentation of underwater target sonar image detection according to claim 7, characterized in that: In the step 4, the training set XL is substituted into the improved YOLOv9 algorithm model, YOLOv3 algorithm model, YOLOv5 algorithm model, YOLOv7 algorithm model and YOLOv9 algorithm model for deep learning, and then the verification set YZ is substituted into the improved YOLOv9 algorithm model, YOLOv3 algorithm model, YOLOv5 algorithm model, YOLOv7 algorithm model and YOLOv9 algorithm model for target detection, and the precision P and recall R are calculated according to the target detection results of each algorithm model.
9. A regional segmentation system for underwater target sonar image detection, applied to the regional segmentation method for underwater target sonar image detection according to any one of claims 1 to 8, characterized in that: It includes image acquisition module, algorithm optimization module and verification and evaluation module; The image acquisition module collects a sonar data set through a network connection to a side-scan sonar, and the sonar data set includes sonar image data of all areas. The image acquisition module uses image processing software to perform data enhancement on the sonar data set and construct an experimental data set SY, and the experimental data set SY includes a training set XL and a verification set YZ, which are used for deep learning and verification evaluation of the algorithm model; The algorithm optimization module sets the YOLOv9 algorithm model as a real-time target detection framework, and based on the YOLOv9 algorithm model, 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 feature information in the experimental data set SY; The verification and evaluation module compares the detection accuracy of the improved YOLOv9 algorithm model with the YOLOv3 algorithm model, the YOLOv5 algorithm model, the YOLOv7 algorithm model and the YOLOv9 algorithm model according to the experimental data set SY, and calculates the average precision mean AP and the F1 score of each algorithm model. If the average precision mean AP and the F1 score of the improved YOLOv9 algorithm model are greater than or equal to the average precision mean AP and the F1 score of other algorithm models, it means that the detection accuracy of the improved YOLOv9 algorithm model is high.
Citation Information
Patent Citations
Field smoke and fire rapid detection method based on unmanned aerial vehicle remote sensing image
CN117437562A
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
Cited By
Submarine cable inspection method and system based on underwater inspection robot
CN121805782A