Side-scan sonar target detection method and device
By building a diverse training sample set and using the LANConvNeXtv2 module, the problem of poor accuracy and robustness of traditional methods when dealing with low contrast and boundary blurred targets is solved, and higher object detection accuracy and adaptability are achieved.
Patent Information
- Application Number
- CN202510368266.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-26
AI Technical Summary
When traditional side-sweep sonar object detection methods deal with targets with low contrast, blurred boundary, obstructed and background noise, there are problems with poor detection accuracy and robustness.
By constructing a training sample set, including multiple subsea background sonar images and target object sonar images, and extracting features based on the backbone network of the LANConvNeXtv2 module, combining the attention mechanism module and the neck network, the object detection model is trained to improve detection accuracy.
It significantly improves the model's perception of low contrast, blur and small targets, and improves the target detection accuracy. It is especially suitable for situations where the target boundaries are unclear or the contrast is low in underwater side-swept sonar images.
Smart Images

Figure CN119888451A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of underwater target detection, and in particular to a side-scan sonar target detection method and device. Background Art
[0002] Side-scan sonar generates high-resolution seabed images by emitting and receiving sound wave signals and is widely used in underwater target detection. However, the targets in the images generated by side-scan sonar usually have the characteristics of low contrast, blurred boundaries, occlusion and high background noise. As a result, traditional target detection methods have poor noise robustness, difficulty in processing multi-scale and multi-angle targets, and false detection and missed detection of targets when detecting targets in side-scan sonar images. Summary of the invention
[0003] In view of this, the present application provides a side-scan sonar target detection method and device to solve the problem of poor detection accuracy and robustness of traditional target detection methods when detecting side-scan sonar images.
[0004] Specifically, the present application is implemented through the following technical solutions: The first aspect of the present application provides a side scan sonar target detection method, the method comprising: Constructing a training sample set, wherein the training sample set includes a plurality of seabed background sonar images and target object sonar images; Training a target detection model based on the training sample set; The target detection model includes a backbone network, a neck network and a detection network connected in sequence, the backbone network extracts features from the sonar image to be detected based on a LANConvNeXtv2 module, the LANConvNeXtv2 module includes a convolution module and an attention mechanism module, the output of the convolution module is connected to the input of the attention mechanism module, and the output of the attention mechanism module is connected to the input of the neck network; The convolution module is used to extract the feature map of the sonar image to be detected, the attention mechanism module calculates the attention value of each block in the feature map based on the relationship between each block and the target object, and generates a first feature map carrying weight information according to the attention value, outputs the first feature map to the neck network, the neck network is used to enhance the first feature map to obtain a second feature map, and the detection network is used to detect the second feature map to obtain a detection result; The trained target detection model is used to perform target detection on the sonar image to be detected to obtain the target detection result.
[0005] A second aspect of the present application provides a side scan sonar target detection device, the device comprising a construction module, a training module and a detection module; wherein: The construction module is used to construct a training sample set, wherein the training sample set includes a plurality of seabed background sonar images and target object sonar images; The training module is used to train the target detection model based on the training sample set; The target detection model includes a backbone network, a neck network and a detection network connected in sequence, the backbone network extracts features from the sonar image to be detected based on a LANConvNeXtv2 module, the LANConvNeXtv2 module includes a convolution module and an attention mechanism module, the output of the convolution module is connected to the input of the attention mechanism module, and the output of the attention mechanism module is connected to the input of the neck network; The convolution module is used to extract the feature map of the sonar image to be detected, the attention mechanism module calculates the attention value of each block in the feature map based on the relationship between each block and the target object, and generates a first feature map carrying weight information according to the attention value, outputs the first feature map to the neck network, the neck network is used to enhance the first feature map to obtain a second feature map, and the detection network is used to detect the second feature map to obtain a detection result; The detection module is used to perform target detection on the sonar image to be detected using the trained target detection model to obtain a target detection result.
[0006] The side-scan sonar target detection method and device provided in the present application effectively solve the problems of uneven target distribution and insufficient samples in side-scan sonar images by constructing a training sample set. Furthermore, the backbone network extracts features from the sonar image to be detected based on the LANConvNeXtv2 module. The convolution module in the LANConvNeXtv2 module is responsible for extracting the feature map of the sonar image to be detected. Its attention mechanism module calculates the attention value based on the relationship between each block in the feature map and the target object, and generates a first feature map carrying weight information. This design based on the local attention mechanism can pay more attention to the details of key areas in the image, especially in low-contrast or blurred conditions, significantly improving the model's perception of low-contrast, blurred and small targets. It is particularly suitable for situations where the target boundaries in underwater side-scan sonar images are unclear or the contrast is low, thereby improving the accuracy of target detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 A flow chart of Embodiment 1 of the side-scan sonar target detection method provided in this application; Figure 2 A schematic diagram of a side-scan sonar image exemplarily shown in this application; Figure 3 This is a schematic diagram of the structure of the target detection model exemplified in this application; Figure 4 This is a schematic diagram of the structure of Example 1 of the side-scan sonar target detection device provided in this application. DETAILED DESCRIPTION
[0008] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0009] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items.
[0010] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0011] Specific embodiments are given below to introduce the technical solution of the present application in detail.
[0012] Figure 1 This is a flow chart of Example 1 of the side scan sonar target detection method provided by this application. Please refer to Figure 1 , the method provided in this embodiment may include: S101, constructing a training sample set, wherein the training sample set includes a plurality of seabed background sonar images and target object sonar images.
[0013] Specifically, the steps of constructing a training sample set include: (1) Obtaining raw seabed sidescan sonar images.
[0014] Specifically, the seabed side-scan sonar raw images can be obtained through side-scan sonar equipment, and the seabed side-scan sonar raw images can also be obtained from existing public data sets. The seabed side-scan sonar raw images contain different seabed substrates (such as sand, rock, etc.) and target objects (such as shipwrecks, airplanes, etc.).
[0015] (2) Construct background processing dataset and target object processing dataset.
[0016] Specifically, in preparation for the subsequent processing of the background and target object, an empty background processing dataset and a target object processing dataset are constructed respectively. The background processing dataset is used to store sample data for processing the background area, and the target object processing dataset is used to store sample data for processing the target object.
[0017] (3) Identify background area pixels in the original seabed sidescan sonar image.
[0018] Specifically, image recognition technology is used to identify target object area pixels and background area pixels in the original seabed side-scan sonar image. In specific implementation, the background and target object in the original image can be distinguished through an image segmentation algorithm, and then the position and attributes of the background area pixels can be determined. For the specific implementation process of using image recognition technology to identify background area pixels, please refer to the description in the relevant technology, which will not be repeated here.
[0019] (4) generating random noise based on the background area pixels, using the random noise to process the target object in the original seabed side-scan sonar image, generating background processing samples, and adding them to the background processing data set.
[0020] Specifically, random noise with similar characteristics can be generated according to the characteristics of pixels in the background area, such as color, grayscale and other distributions, and these noises can be randomly added to the target object area in the original seabed side-scan sonar image to simulate the interference of noise on the target in a complex seabed environment, thereby obtaining background processing samples, and then adding the background processing samples to the background processing data set.
[0021] (5) Identifying the boundary of the target object in the original seabed side-scan sonar image, processing the pixels within the boundary, generating target object samples, and adding them to the target object processing data set.
[0022] Specifically, the boundaries of target objects (such as aircraft and sunken ships) in the original seabed side-scan sonar images can be identified through image edge detection algorithms or based on specific features of the target objects. For the pixels within the boundaries, operations such as cropping, scaling, and rotation are performed to generate target object samples of various forms. The generated target object samples are then added to the target object processing data set to enrich the learning samples of the target objects during model training and improve the model's ability to recognize targets of different postures and scales.
[0023] (6) Mix the background processed data set and the target object processed data set to obtain a training sample set.
[0024] Specifically, the background processing data set and the target object processing data set that have been processed as above are mixed and their order is disrupted. The training sample set obtained in this way includes samples under various background interferences and target object samples with different processing methods, which can better simulate the complex actual seabed environment and be used to train the seabed side-scan sonar image target detection model, thereby improving the detection accuracy and robustness of the model in complex environments.
[0025] Furthermore, the step of constructing a training sample set may also include: (1) Constructing an initial data set, wherein the initial data set includes a plurality of seabed background sonar images and target object sonar images.
[0026] Specifically, the initial data set is the SeabedObjects-KLSG side-scan sonar data set built with the support of several sonar equipment suppliers such as Lcocean, Hydro-tech Marine, Klein Marine, Tritecand EdgeTech, etc. This data set constitutes the initial data set, which contains 578 seabed background sonar images, 385 shipwrecks and 62 aircraft sonar image data. The shipwreck and aircraft sonar images are the target object sonar images. It can be understood that the shipwreck and the aircraft are the target objects that the target detection model needs to learn. Furthermore, the seabed background sonar image is a seabed sonar image that does not contain the target object, and the target object sonar image is a seabed sonar image that contains the target object. Figure 2 For a schematic diagram of a side scan sonar image exemplified in this application, please refer to Figure 2 , Figure 2 Parts (a) and (b) are schematic diagrams of sonar images of target objects. Figure 2 Part (c) is a schematic diagram of the seabed background sonar image.
[0027] (2) extracting the target object from the target object sonar image, and combining the extracted target object with the seabed background sonar image to form a plurality of first target object sonar images.
[0028] Specifically, the specific implementation steps of forming multiple sonar images of the first target object include: 2.1. Determine target object pixels according to the binary mask of each pixel in the sonar image of the target object, retain the target object pixels, and determine the target object according to the target object pixels.
[0029] Specifically, the target object can be extracted from the sonar image of the target object by the following formula: ; in, is the pixel coordinate of the target object in the sonar image; is the binary mask of the target object in the sonar image of the target object. If the pixel coordinate (x, y) belongs to the target object, then =1, if the pixel coordinate (x, y) does not belong to the target object, then =0; is the pixel coordinate of the target object.
[0030] 2.2. Paste the target object into the seabed background sonar image to obtain the multiple first target object sonar images.
[0031] Specifically, after the target object is extracted, the target object and the seabed background sonar image can be synthesized by the following formula: ; in, is the pixel coordinate of the sonar image of the first target object; is the pixel coordinate of the seabed background sonar image; is the pixel coordinate of the target object; is the binary mask of the target object in the sonar image of the target object. If the pixel coordinate (x, y) belongs to the target object, then =1, if the pixel coordinate (x, y) does not belong to the target object, then =0.
[0032] For the target object sonar image, the background area of the non-target object in the image is retained and the extracted target object is covered in the corresponding area. For the seabed background sonar image, the extracted target object is directly and randomly covered in the image, so as to obtain multiple first target object sonar images.
[0033] Furthermore, after the target object is extracted, the extracted target object can be randomly rotated and scaled to ensure that the target object is not unchanged when synthesized into a new background image, thereby expanding the diversity of target objects in the data set. By processing the target object sonar images in the initial data set, the targets in 385 shipwrecks and 62 aircraft sonar images were extracted and pasted into 578 seabed background sonar images, and 5,700 first target object sonar images were obtained.
[0034] (3) stitching the target object sonar image and the first target object sonar image to form a plurality of second target object sonar images.
[0035] Specifically, in side-scan sonar images, target objects may have different sizes and shapes, and it is difficult for the model to learn comprehensive feature representations using image data of a single scale. By constructing multi-scale images, the model can learn the feature differences of targets at different scales and improve the detection capabilities of targets of different sizes.
[0036] Specifically, the specific implementation steps of splicing the target object sonar image and the first target object sonar image to form a plurality of second target object sonar images include: 3.1. Determine the target object sonar image and the first target object sonar image as a first scale image.
[0037] Specifically, the target object sonar image and the first target object sonar image are uniformly determined as a first scale image. This step provides a basic data source for subsequent multi-scale image construction. In addition, in the first scale image, one image contains only one target object.
[0038] 3.2. Randomly select M images from the first-scale images, and splice the M images to form a second-scale target image.
[0039] Specifically, the value of M is set according to actual needs and is not limited in this embodiment. For example, in one embodiment, M=4, 4 images are randomly selected from the first scale image, and the 4 images are randomly spliced to obtain the second scale target image. It should be noted that when randomly selecting images from the first scale image, each image in the first scale image can only be selected once.
[0040] 3.3. Randomly select N images from the first-scale images, and splice the N images to form a third-scale target image.
[0041] Specifically, the value of N is set according to actual needs and is not limited in this embodiment. For example, in one embodiment, N=9. Referring to the above description, similarly, 9 images are randomly selected from the first scale image and the 9 images are spliced to form a third scale target image. It should be noted that the size of N is greater than M.
[0042] 3.4. Use the first scale image, the second scale target image and the third scale target image as the second target object sonar image.
[0043] Specifically, the first scale image, the second scale target image, and the third scale target image are used together as the second target object sonar image, thus forming a second target object sonar image containing information of multiple scales. In the subsequent model training process, the target detection model can learn the features of the target at different feature levels, thereby improving the detection accuracy and robustness of the target detection model for targets of different scales. For example, in a complex underwater environment, there may be small target objects (such as small sunken ship parts) and large target objects (such as complete sunken ships or large underwater facilities). The target detection model trained with this multi-scale image can more effectively detect these targets of different sizes and reduce missed detections and false detections.
[0044] (4) performing enhancement processing on the target object sonar image, the first target object sonar image, and the second target object sonar image to form a plurality of third target object sonar images.
[0045] Specifically, the enhancement processing of the sonar image of the target object, the sonar image of the first target object, and the sonar image of the second target object includes Cutout processing and noise addition processing. Cutout processing refers to randomly selecting and generating a square occlusion area in the image and setting its pixel value to zero, thereby simulating the partial occlusion of the target object by sediments, seabed structures or ocean clutter in the seabed environment. Noise addition processing refers to adding different types of noise such as Gaussian noise and salt and pepper noise to the image to simulate the actual seabed noise interference scene, so that the target detection model can learn to recognize and adapt to target features under various noise conditions during the training process. Enhancement processing of the above images can enhance the ability of the target detection model to infer the complete form of the target under information loss conditions, while improving the generalization performance of the target detection model and the robustness to complex occlusion scenes. Further, the anti-noise ability of the target detection model is improved, the negative impact of noise on detection is reduced, and the risk of missed detection and false detection of the target object by the target detection model is reduced.
[0046] Furthermore, in addition to the above-mentioned method for globally enhancing the image, the steps for forming a plurality of sonar images of the third target object also include: 4.1. Determine the target object in the target object sonar image, the first target object sonar image, and the second target object sonar image.
[0047] Specifically, image processing algorithms can be used to locate and identify the target object based on the grayscale difference between the target object and the background, or based on the unique geometric shape of the target object, and different feature extraction and target positioning methods can be used for different sonar images. For example, for some simple target objects, a threshold-based segmentation method can be used to identify areas with grayscales above or below the threshold as target objects; for complex target objects, more complex edge detection and contour analysis algorithms, such as the Canny edge detection algorithm, can be used to find the contour of the target object, and then determine its position and range. For the specific implementation process of determining the target object in the image, please refer to the description in the relevant technology, which will not be repeated here.
[0048] 4.2. Preprocess the target object to obtain the sonar image of the third target object.
[0049] Specifically, after determining the position and size of the target object in the image, the target object is enhanced to obtain a third target object sonar image. For the implementation steps of the enhanced processing of the target object, please refer to the above description, which will not be repeated here. This method only performs enhanced processing on the target object in the image to obtain the third target object sonar image, which helps to make the target detection model pay more attention to the characteristics of the target object in the subsequent model training process and enhance the detection accuracy.
[0050] (5) Updating the target object sonar image, the first target object sonar image, the second target object sonar image, and the third target object sonar image into the initial data set to obtain a training sample set.
[0051] Specifically, after a series of processing in the above steps, the initial data set has been greatly expanded and enriched, forming a more comprehensive and diverse training sample set. The training sample set contains sonar images of target objects in different scenes, different combinations, and different conditions, providing rich sample data for subsequent target detection model training, which helps to train a target detection model with stronger generalization ability and better robustness.
[0052] S102, training a target detection model based on the training sample set; The target detection model includes a backbone network, a neck network and a detection network connected in sequence, the backbone network extracts features from the sonar image to be detected based on a LANConvNeXtv2 module, the LANConvNeXtv2 module includes a convolution module and an attention mechanism module, the output of the convolution module is connected to the input of the attention mechanism module, and the output of the attention mechanism module is connected to the input of the neck network; The convolution module is used to extract the feature map of the sonar image to be detected. The attention mechanism module calculates the attention value of each block in the feature map based on the relationship between each block and the target object, and generates a first feature map carrying weight information according to the attention value, and outputs the first feature map to the neck network. The neck network is used to enhance the first feature map to obtain a second feature map. The detection network is used to detect the second feature map to obtain a detection result.
[0053] Specifically, the target detection model selects the YOLOv8 model as the basic model for target detection in side-scan sonar images in complex environments. YOLOv8 is one of the versions of the YOLO (You Only Look Once) series. It has the advantages of high speed and high precision of the YOLO series, and has been significantly optimized in terms of architecture, detection capability and efficiency. However, in underwater environments, the targets of sonar images usually have extremely low contrast, which poses a significant challenge to target detection. Unlike traditional optical images, sonar images are usually obtained under complex underwater conditions due to the particularity of their generation method, and the contrast between the target object and the background in the image is often very low. This low-contrast phenomenon greatly increases the difficulty of distinguishing between the target and the background, making it difficult for traditional computer vision technology to effectively identify the target object. In addition to the low-contrast problem, there are a large number of complex noise sources and interference factors in the underwater environment. These noises include reflections from the seabed, ocean clutter, and sensor noise of the sonar equipment itself. Although the YOLOv8 model is a powerful target detection model that has shown excellent results in general target detection tasks, it still has the problem of insufficient feature extraction capabilities when faced with sonar images with low contrast and complex noise.
[0054] Figure 3 Please refer to the schematic diagram of the target detection model shown in this application. Figure 3The target detection model proposed in this embodiment is based on the initial structure of the YOLOv8 model, including a backbone network, a neck network and a detection network. The backbone network extracts features from the sonar image to be detected based on the LANConvNeXtv2 module. The LANConvNeXtv2 module includes a convolution module and an attention mechanism module. The output of the convolution module is connected to the input of the attention mechanism module, and the output of the attention mechanism module is connected to the input of the neck network.
[0055] Among them, the backbone network includes multiple convolution modules, CSPLayer_2Conv (C2f), LANConvNeXtV2, etc. ConvModule is used to perform preliminary feature extraction on the input image and extract the basic features of the image through convolution operations; CSPLayer_2Conv (C2f) is a cross-stage local network structure that can effectively reduce the amount of calculation and enhance the feature extraction capability; LANConvNeXtV2 is a convolution module combined with specific improvements for further extracting and processing image features. The backbone network starts with the input image, gradually extracts features and downsamples, and continuously extracts more advanced and abstract features through the combination of different modules, providing a basis for subsequent feature fusion and target detection. As the number of network layers increases, the image size gradually decreases and the feature dimension gradually increases to capture richer semantic information in the image.
[0056] The neck network contains multiple modules such as ConvModule, CSPLayer_2Conv (C2f), SPPF (spatial pyramid pooling fusion), etc. The SPPF module is used to perform multi-scale pooling operations on feature maps, fuse features of different scales, and enhance the model's adaptability to targets of different sizes; ConvModule and CSPLayer_2Conv (C2f) continue to process and fuse features; the neck network mainly plays the role of feature fusion and adjustment. It receives feature maps of different levels output by the backbone network, and fuses features of different scales through processing by various modules, so that the network can better handle multi-scale targets, while reducing information loss and improving the expressiveness of features.
[0057] The detection network includes multiple SequentiaL feature processing modules, DEL optimization modules and ImplicitHead implicit learning modules. The SequentiaL feature processing module is used to output detection results of different scales, the DEL optimization module is used to further optimize the detection results, and the ImplicitHead implicit learning module is used to further process the feature map to generate the final detection output; the detection network performs target detection based on the features fused by the neck network. Through different module connections, feature maps of different scales are processed to detect targets of different sizes and positions in the image. Feature output layers of different scales can detect targets of different sizes. Finally, the detection results are optimized through modules such as DEL to generate the final detection output.
[0058] Furthermore, the convolution module includes a two-dimensional convolution layer, a multi-scale convolution layer, a fusion layer and a dimension reduction layer; the output of the two-dimensional convolution layer is connected to the input of the multi-scale convolution layer, the output of the multi-scale convolution layer is connected to the input of the fusion layer, and the output of the fusion layer is connected to the input of the dimension reduction layer; The two-dimensional convolution layer is used to extract the local features of the sonar image to be detected. The multi-scale convolution layer extracts features of different scales of the local features through convolution kernels of different sizes to obtain the features of different scales. The fusion layer is used to fuse the features of different scales to obtain fused features. The dimensionality reduction layer is used to perform channel dimensionality reduction on the fused features to obtain reduced dimensionality features, and the reduced dimensionality features are used as the output of the convolution module.
[0059] Specifically, the two-dimensional convolution layer slides the convolution kernel on the image, performs convolution operation with the local area of the image, and performs weighted summation of the local pixel information to generate a new feature map. In this process, the weight of the convolution kernel is continuously adjusted during the training process to learn the pattern that best represents the local features of the image. The local features of the image to be detected can be extracted using the following formula: ; in, is the convolution kernel in the two-dimensional convolution layer; is the input image to be detected; is the bias term.
[0060] The multi-scale convolution layer extracts features of different scales of local features through convolution kernels of different sizes. Convolution kernels of different sizes can capture information of different ranges. Large convolution kernels can cover larger areas and obtain more macroscopic features, while small convolution kernels focus more on local details. Features of different scales can be extracted using the following formula: ; in, is a set of scales; is the convolution kernel weight of scale s; It is a local feature; is the bias term corresponding to scale s.
[0061] Furthermore, the fusion layer fuses features of different scales to obtain fused features. Additive fusion can be performed using the following formula: ; in, is the feature map at scale s.
[0062] You can also use the following formula to perform splicing and fusion: ; in, is the feature map at scale s.
[0063] Furthermore, in deep learning, feature maps usually have high dimensions, which may lead to problems such as excessive computation and overfitting. The dimension reduction layer can reduce the number of channels of the fused features while retaining important information by convolving the fused features with a 1x1 convolution kernel. This can reduce the number of model parameters and improve computational efficiency, while also making the fused features more compact, which is helpful for subsequent processing and the final object detection task.
[0064] Furthermore, after the convolution module performs a convolution operation on the image to be detected and outputs the reduced dimension features, the reduced dimension features are input into the attention mechanism module. The attention mechanism module calculates the attention value of each block in the reduced dimension features through the sigmoid function. The attention value is applied to the reduced dimension features as weight information to generate the first feature map. The first feature map carrying weight information can be generated by the following formula: ; in, is the weight information of the attention value corresponding to block a; is the dimension reduction feature of the input; is the sigmoid function.
[0065] Specifically, the attention mechanism module enables the target detection model to focus on key target features and reduce attention to noise areas, thereby improving detection accuracy. Furthermore, the neck network is used to enhance the first feature map to improve the effect of subsequent processing and provide better feature information for the final task (such as target detection, classification, etc.). The specific implementation steps include: (1) Calculating sampling points of the target object according to the scale information of the first feature map, and forming a sampling point set according to the sampling points.
[0066] Specifically, the specific implementation steps of calculating the sampling points of the target object include: 1.1. Determine a range factor and an offset, wherein the range factor includes a static range factor and a dynamic range factor.
[0067] Specifically, the static range factor is usually a pre-set fixed value, which may be determined based on experience or a general understanding of the data. Its purpose is to provide a basic range reference for determining the sampling points. Specifically, the static range factor can be determined based on the size information of the target object, and the size of the target object can be used as the static range factor. The dynamic range factor changes according to the real-time information of the first feature map or the current state of the target object. It can dynamically adjust the sampling range according to the different characteristics of the target object in the feature map (such as the size, position, intensity, etc. of the target object) to better adapt to various different situations. It is understandable that in this step, the static range factor and the dynamic range factor can be set according to the scale information of the first feature map according to the empirical value.
[0068] 1.2. Calculate a static range factor offset according to the static range factor, and calculate a dynamic range factor offset according to the dynamic range factor.
[0069] Specifically, the static range factor offset can be calculated by the following formula: ; in, is the first feature map; is to perform a linear transformation on the first feature map.
[0070] In the static range factor offset calculation formula, the first feature map is transformed through a linear transformation, and the output size is H×W×2gs 2 ; After being scaled by a factor of 0.25, it is rearranged into size sH×sW×2g through the Pixel Shuffle operation.
[0071] The dynamic range factor offset can be calculated by the following formula: .
[0072] In the dynamic range factor offset calculation formula, the first feature map is transformed twice to obtain two sets of tensors. These two sets of tensors are element-by-element added and multiplied by a factor of 0.25, and then converted to the target size sH×sW×2g through Pixel_Shuffle.
[0073] 1.3. Determine the sampling point according to the sum of the static range factor and the static range factor offset and the sum of the dynamic range factor and the dynamic range factor offset.
[0074] Specifically, the static range factor and the static range factor offset are added to obtain an adjusted static range, and the dynamic range factor and the dynamic range factor offset are added to obtain an adjusted dynamic range. According to the two adjusted ranges, corresponding sampling points are selected in the first feature map.
[0075] Furthermore, for the first feature map with only background, the range factor provides the initial sampling distribution, and the offset introduces dynamic adjustment. The static range factor fixes the offset generation strategy, while the dynamic range factor combines two linear transformations to further improve the flexibility and adaptability of sampling.
[0076] Furthermore, dynamic sampling can focus on the target area for sampling. In the first feature map with the target object, the neck network can generate more sampling points in and around the target area according to the position and scale information of the target, thereby enhancing the ability to extract the features of the target object. When the target object is partially occluded, the sampling points will be concentrated in the unobstructed target area and the occluded edge, so as to obtain the effective features of the target as much as possible and improve the detection accuracy.
[0077] Specifically, the feature differences of each area in the first feature map are determined, and the classification of the first feature map is determined based on the feature differences. The categories of the first feature map include seabed background and target. Under the seabed background category, the feature differences of each area of the first feature map are less than a threshold value. Under the target category, the feature differences of each area of the first feature map are greater than a threshold value. The change rate of the dynamic range factor is determined according to the classification result. The change rates of the seabed background category and the target category are different, and the change rate of the seabed background category is less than the change rate of the target category. The method for determining each area is as follows: determining the size information of the target, and dividing the first feature map into regions based on the size information.
[0078] (2) Using a Grid Sample operation, the sampling point set and the first feature map are processed to obtain a sampled second feature map.
[0079] Specifically, Grid Sample can extract information from the first feature map based on the sampling point collection. This operation can flexibly resample the feature map, obtain the pixel value of the corresponding position from the first feature map according to the position of the sampling point, and generate a new feature map according to certain interpolation rules. For the implementation steps of using the Grid Sample operation to process the sampling point collection and the first feature map, please refer to the description in the relevant technology, which will not be repeated here.
[0080] Furthermore, the detection network implicitly processes the input second feature map through the ImplicitHead module, thereby more efficiently capturing key information in the image and reducing noise interference. For the implementation steps of implicitly processing the second feature map using ImplicitHead, please refer to the description in the related art, which will not be repeated here.
[0081] S103, using the trained target detection model to perform target detection on the sonar image to be detected, to obtain a target detection result.
[0082] Specifically, the sonar image to be detected has the characteristics of low contrast between the target object and the background, blurred boundaries of the target object, noise interference and multi-scale targets. Since the side-scan sonar image is generated by transmitting and receiving sound waves, it is greatly affected by the underwater environment. The absorption and scattering of sound waves by the water body and the reflection of the complex seabed bottom make the contrast between the target object and the background in the image extremely low. Targets such as shipwrecks and airplanes are difficult to distinguish from the background in sonar images by grayscale or color differences. In addition, the underwater environment is complex, and the targets are often attached by sediments and marine organisms, or due to the propagation characteristics of sound waves, the boundaries of target objects in the sonar image are unclear. When part of the target is obscured, the boundary is more difficult to determine, which makes the target detection method based on boundary features ineffective, and it is difficult for the model to accurately outline the target and determine its position.
[0083] Specifically, the target detection model is trained based on the constructed training sample set. During the training process, the sonar images in the training sample set are input into the target detection model, and the model processes the images according to its internal structure and parameters to predict the results. Then, the predicted results are compared with the actual labeled results, and the error is calculated through the loss function (such as cross entropy loss, mean square error, etc.).
[0084] Optimization algorithms (such as stochastic gradient descent, Adam, etc.) are used to update the model parameters according to the error, so that the model is gradually optimized in the process of continuous iteration, reducing the gap between the predicted results and the actual results, and improving the accuracy and performance of target detection.
[0085] Furthermore, the sonar image to be detected is input into the trained target detection model. The target detection model will extract features through the backbone network, enhance features through the neck network, and detect features through the detection network in sequence, and finally output the detection results, such as the location information of the target object (which may be represented in the form of a bounding box) and category information.
[0086] The side-scan sonar target detection method provided in this embodiment effectively solves the problems of uneven target distribution and insufficient samples in side-scan sonar images by constructing a training sample set. By copying and pasting the target object in the sonar image of the target object to different positions, backgrounds or scales, it also simulates the target occlusion and uneven target distribution that may be encountered in the underwater environment, solves the problems of small amount of side-scan sonar target image data and insufficient underwater target detection in complex underwater environments, enables the target detection model to be trained and tested in various complex environments, and enhances the robustness of the target detection model in training. Furthermore, the backbone network extracts features from the sonar image to be detected based on the LANConvNeXtv2 module. The convolution module in the LANConvNeXtv2 module is responsible for extracting the feature map of the sonar image to be detected. Its attention mechanism module calculates the attention value based on the relationship between each block in the feature map and the target object, and generates a first feature map carrying weight information. This design based on the local attention mechanism can pay more attention to the details of key areas in the image, especially in low-contrast or blurred conditions, significantly improving the model's perception of low-contrast, blurred and small targets. It is particularly suitable for underwater side-scan sonar images with unclear target boundaries or low contrast, thereby improving target detection accuracy.
[0087] Corresponding to the aforementioned embodiment of a side-scan sonar target detection method, the present application also provides an embodiment of a side-scan sonar target detection device.
[0088] Figure 4 This is a schematic diagram of the structure of the side scan sonar target detection device embodiment 1 provided in this application. Figure 4 The device provided in this embodiment includes a construction module 410, a training module 420 and a detection module 430; wherein, The construction module 410 is used to construct a training sample set, wherein the training sample set includes a plurality of seabed background sonar images and target object sonar images; The training module 420 is used to train the target detection model based on the training sample set; The target detection model includes a backbone network, a neck network and a detection network connected in sequence, the backbone network extracts features from the sonar image to be detected based on a LANConvNeXtv2 module, the LANConvNeXtv2 module includes a convolution module and an attention mechanism module, the output of the convolution module is connected to the input of the attention mechanism module, and the output of the attention mechanism module is connected to the input of the neck network; The convolution module is used to extract the feature map of the sonar image to be detected, the attention mechanism module calculates the attention value of each block in the feature map based on the relationship between each block and the target object, and generates a first feature map carrying weight information according to the attention value, outputs the first feature map to the neck network, the neck network is used to enhance the first feature map to obtain a second feature map, and the detection network is used to detect the second feature map to obtain a detection result; The detection module 430 is used to perform target detection on the sonar image to be detected using the trained target detection model to obtain a target detection result.
[0089] The device of this embodiment can be used to perform Figure 1 The steps, specific implementation principles and implementation processes of the method embodiment shown are similar and will not be repeated here.
[0090] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0091] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0092] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A side scan sonar target detection method, characterized in that: The method comprises: Constructing a training sample set, wherein the training sample set includes a plurality of seabed background sonar images and target object sonar images; Training a target detection model based on the training sample set; The target detection model includes a backbone network, a neck network and a detection network connected in sequence, the backbone network extracts features from the sonar image to be detected based on a LANConvNeXtv2 module, the LANConvNeXtv2 module includes a convolution module and an attention mechanism module, the output of the convolution module is connected to the input of the attention mechanism module, and the output of the attention mechanism module is connected to the input of the neck network; The convolution module is used to extract the feature map of the sonar image to be detected, the attention mechanism module calculates the attention value of each block in the feature map based on the relationship between each block and the target object, and generates a first feature map carrying weight information according to the attention value, outputs the first feature map to the neck network, the neck network is used to enhance the first feature map to obtain a second feature map, and the detection network is used to detect the second feature map to obtain a detection result; The trained target detection model is used to perform target detection on the sonar image to be detected to obtain the target detection result.
2. The method according to claim 1, characterized in that The convolution module includes a two-dimensional convolution layer, a multi-scale convolution layer, a fusion layer and a dimension reduction layer; the output of the two-dimensional convolution layer is connected to the input of the multi-scale convolution layer, the output of the multi-scale convolution layer is connected to the input of the fusion layer, and the output of the fusion layer is connected to the input of the dimension reduction layer; The two-dimensional convolution layer is used to extract the local features of the sonar image to be detected. The multi-scale convolution layer extracts features of different scales of the local features through convolution kernels of different sizes to obtain the features of different scales. The fusion layer is used to fuse the features of different scales to obtain fused features. The dimensionality reduction layer is used to perform channel dimensionality reduction on the fused features to obtain reduced dimensionality features, and the reduced dimensionality features are used as the output of the convolution module.
3. The method according to claim 1, characterized in that The neck network is used to enhance the first feature map; comprising: Calculate the sampling points of the target object according to the scale information of the first feature map, and form a sampling point collection according to the sampling points; The sampling point collection and the first feature map are processed using a Grid Sample operation to obtain a sampled second feature map.
4. The method according to claim 3, characterized in that The step of calculating the sampling points of the target object according to the scale information of the first feature map comprises: Determining a range factor and an offset, the range factor comprising a static range factor and a dynamic range factor; Calculating a static range factor offset according to the static range factor, and calculating a dynamic range factor offset according to the dynamic range factor; The sampling point is determined according to a sum of the static range factor and the static range factor offset and a sum of the dynamic range factor and the dynamic range factor offset.
5. The method according to claim 1, characterized in that The step of constructing a training sample set includes: Obtain original seabed side-scan sonar images; Construct background processing dataset and target object processing dataset; Identifying background area pixels in the seabed sidescan sonar raw image; Generate random noise based on the background area pixels, use the random noise to process the target object in the seabed side-scan sonar original image, generate background processing samples, and add them to the background processing data set; Identify the boundary of the target object in the original seabed side-scan sonar image, process the pixels within the boundary, generate target object samples, and add them to the target object processing data set; The background processed data set and the target object processed data set are mixed to obtain a training sample set.
6. The method according to claim 1, characterized in that The constructing of the training sample set also includes: Constructing an initial data set, wherein the initial data set includes a plurality of seabed background sonar images and target object sonar images; Extracting the target object from the target object sonar image, and combining the extracted target object with the seabed background sonar image to form a plurality of first target object sonar images; performing splicing processing on the target object sonar image and the first target object sonar image to form a plurality of second target object sonar images; performing enhancement processing on the target object sonar image, the first target object sonar image, and the second target object sonar image to form a plurality of third target object sonar images; The target object sonar image, the first target object sonar image, the second target object sonar image and the third target object sonar image are updated to the initial data set to obtain a training sample set.
7. The method according to claim 6, characterized in that The forming of a plurality of first target object sonar images comprises: Determining target object pixels according to a binary mask of each pixel in the sonar image of the target object, retaining the target object pixels, and determining the target object according to the target object pixels; The target object is pasted into the seabed background sonar image to obtain the plurality of first target object sonar images.
8. The method according to claim 6, characterized in that The forming of a plurality of sonar images of the second target object comprises: Determine the target object sonar image and the first target object sonar image as a first scale image; Randomly select M images from the first-scale images, and splice the M images to form a second-scale target image; Randomly select N images from the first-scale images, and splice the N images to form a third-scale target image; The first scale image, the second scale target image and the third scale target image are used as the second target object sonar images.
9. The method according to claim 6, characterized in that The forming of a plurality of sonar images of the third target object also includes: Determine the target object in the target object sonar image, the first target object sonar image, and the second target object sonar image; The target object is preprocessed to obtain the sonar image of the third target object.
10. A side scan sonar target detection device, characterized in that: The device comprises a construction module, a training module and a detection module; wherein, The construction module is used to construct a training sample set, wherein the training sample set includes a plurality of seabed background sonar images and target object sonar images; The training module is used to train the target detection model based on the training sample set; The target detection model includes a backbone network, a neck network and a detection network connected in sequence, the backbone network extracts features from the sonar image to be detected based on a LANConvNeXtv2 module, the LANConvNeXtv2 module includes a convolution module and an attention mechanism module, the output of the convolution module is connected to the input of the attention mechanism module, and the output of the attention mechanism module is connected to the input of the neck network; The convolution module is used to extract the feature map of the sonar image to be detected, the attention mechanism module calculates the attention value of each block in the feature map based on the relationship between each block and the target object, and generates a first feature map carrying weight information according to the attention value, outputs the first feature map to the neck network, the neck network is used to enhance the first feature map to obtain a second feature map, and the detection network is used to detect the second feature map to obtain a detection result; The detection module is used to perform target detection on the sonar image to be detected using the trained target detection model to obtain a target detection result.
Citation Information
Patent Citations
Sonar target detection method and device based on improved YOLOv4
CN116152649A
Side-scan sonar image target detection method and system based on shadow features
CN116740528A
Seabed target detection method based on BES-YOLOv8 model
CN118736187A
Side-scan sonar shipwreck image target detection method
CN118823328A
Side-scan sonar image submarine cable zero sample rapid detection method
CN119624957A