A method, system, equipment and medium for underwater target detection

By using multi-scale feature extraction of the Lightweight-YOLOv8 model and the EACIOU loss function, the problem of low accuracy in underwater target detection is solved, and efficient target detection is achieved in resource-constrained environments.

CN120808131BActive Publication Date: 2025-12-02NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing underwater target detection models have insufficient feature extraction capabilities, resulting in low underwater target detection accuracy. In particular, they are not good at recognizing low-contrast, small, or blurred targets. Furthermore, the models have a large number of parameters and slow inference speed, making them difficult to deploy on UUVs with limited computing resources.

Method used

We employ the Lightweight-YOLOv8 model, combining grouped convolution and channel recombination operations to extract multi-scale features. By combining local detail information with global semantic information, we use a lightweight C2F module and the EACIOU loss function to enhance the perception of blurred edge targets.

Benefits of technology

It improves the accuracy of underwater target detection, enhances the deployment flexibility and detection efficiency of the model in resource-constrained environments, and improves the ability to identify targets with low contrast and blurred boundaries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808131B_ABST
    Figure CN120808131B_ABST
Patent Text Reader

Abstract

This invention relates to the field of target detection technology and discloses an underwater target detection method, system, device, and medium. The method includes: acquiring an underwater MFLS image; inputting the MFLS image into an underwater target detection model, extracting features from the MFLS image at different scales and depths to obtain shallow, mid-level, and deep features at different scales; dividing the channels of the deep features into several groups, convolving the features of each group of channels, rearranging the features of each group of channels after convolution to allow interaction between the features of each group of channels, and obtaining global features; extracting local features from different receptive fields of the deep features, and fusing the local features of different receptive fields with the global features to supplement the local details of the global features, thereby obtaining the target deep features of the MFLS image; and performing underwater target detection on the MFLS image based on the shallow, mid-level, and target deep features of the MFLS image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, and in particular to an underwater target detection method, system, device and medium. Background Technology

[0002] With advancements in marine technology and the ever-growing demand for underwater resource utilization, unmanned underwater vehicles (UUVs) have become indispensable platforms for modern marine exploration, surveillance, and combat missions. In this complex and dynamic underwater environment, the navigation and target detection capabilities of UUVs play a crucial role in ensuring mission efficiency and operational success. However, the unique challenges posed by the underwater environment, such as low-light conditions, strong scattering effects, and blurred target features, make traditional optical vision-based sensors less effective for reliable detection. In contrast, multi-beam forward-looking sonar (MFLS) actively emits sound waves to construct depth-sensing images, demonstrating strong adaptability in turbid waters and offering significant application potential for underwater target detection missions.

[0003] The low resolution, limited texture features, and complex background noise of MFLS images pose significant challenges to target detection models. Continuous advancements in image processing technology have driven the development of many traditional sonar image target detection models (i.e., MFLS image target detection models). These traditional models primarily rely on the acquisition and processing of echo signals, generating underwater target images through beamforming and signal reconstruction techniques. These models typically employ manual feature extraction methods, such as template matching and edge detection, to identify and locate targets. While these traditional target detection models have achieved significant progress in general vision tasks, their detection accuracy and robustness often fall short of practical requirements when processing MFLS images.

[0004] With the rapid development of deep learning technology, new opportunities have emerged for sonar image recognition. Deep learning-based recognition models have achieved breakthroughs in various visual tasks due to their powerful feature extraction and pattern recognition capabilities. However, in underwater MFLS image detection, existing models mostly employ single-scale or shallow feature fusion strategies, resulting in limited feature extraction capabilities and low accuracy in underwater target detection. Summary of the Invention

[0005] The purpose of this invention is to provide an underwater target detection method, system, device, and medium that can solve the problem of low underwater target detection accuracy caused by insufficient feature extraction capability of existing models.

[0006] To address the aforementioned technical problems, embodiments of the present invention provide an underwater target detection method, comprising the following steps:

[0007] Acquire underwater multibeam forward-looking sonar (MFLS) images;

[0008] The MFLS image is input into the trained underwater target detection model, and features at different scales and depths are extracted from the MFLS image to obtain shallow, medium and deep features of the MFLS image at different scales.

[0009] The deep feature channels are divided into several groups, the features of each group are convolved, and the features of each group are rearranged after convolution to allow the features of each group to interact and obtain global features.

[0010] Local features of different receptive fields in the deep feature extraction process are extracted and fused with global features to supplement local details of global features in order to obtain target deep features of the MFLS image.

[0011] Underwater target detection is performed on MFLS images based on shallow, mid-level, and deep target features.

[0012] Optionally, the network structure of the underwater target detection model includes: a shallow feature extraction module composed of a CBS module and an LWC2F module, a mid-level feature extraction module composed of a CBS module and a ShuffleNetV2 module, and a deep feature extraction module composed of a CBS module and an LWC2F module.

[0013] The CBS module includes convolutional layers, batch normalization layers, and SiLU activation function layers to extract features at the corresponding scales of the shallow feature extraction module, the mid-level feature extraction module, or the deep feature extraction module.

[0014] The LWC2F module processes the features output by the shallow or deep feature extraction module's CBS module through a convolutional layer. The processed features are divided into two parts. One part of the features is extracted again through an inverse residual block and then fused with the other part of the features from the short connections. The fused features are then integrated through a convolutional layer to obtain shallow or deep features.

[0015] The ShuffleNetV2 module is used to extract global features from the CBS module output of the mid-layer feature extraction module, and use them as mid-layer features.

[0016] Optionally, the loss function of the underwater target detection model includes a first loss function and a second loss function;

[0017] The first loss function is constructed based on the degree of matching between the predicted bounding box and the ground truth bounding box, while the second loss function is constructed based on the influence of the edge information of the MFLS image on the degree of matching between the predicted bounding box and the ground truth bounding box.

[0018] Optionally, the loss function of the underwater target detection model is:

[0019] ;

[0020] In the formula, For the first loss function, For the second loss function, These are preset weight parameters used to control the impact of the second loss function on the loss function of the underwater target detection model;

[0021] ;

[0022] In the formula, The weights of each edge pixel in the MFLS image. N The number of edge pixels. This is the weight matrix of the edge pixels in the MFLS image. for Loss function;

[0023] ;

[0024] ;

[0025] ;

[0026] ;

[0027] ;

[0028] In the formula, Let be the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box, and let c be the minimum diagonal length of the bounding box containing both the predicted and ground truth bounding boxes. and These are the predicted bounding box and the ground truth bounding box, respectively. The width of the actual bounding box. The actual height of the bounding box. The width of the prediction box. This represents the height of the predicted bounding box.

[0029] Optionally, the weight matrix of the edge pixels of the MFLS image is obtained through the following steps:

[0030] Denoising is performed on the grayscale image of the MFLS image to obtain a smooth image;

[0031] Calculate the horizontal and vertical gradients of the smoothed image, and based on the horizontal and vertical gradients, obtain the gradient magnitude and gradient direction of each pixel in the smoothed image;

[0032] For each pixel, the gradient magnitude of neighboring pixels is obtained along the gradient direction of the pixel. When the gradient magnitude of a neighboring pixel is a local maximum, the pixel is retained to refine the edges of the smooth image.

[0033] The remaining pixels are divided into two categories, strong edge pixels and weak edge pixels, according to the gradient magnitude. Strong edge pixels are considered as edge pixels, and pixels in the weak edge pixels that are connected to strong edge pixels are also considered as edge pixels.

[0034] The weight matrix of the edge pixels in the MFLS image is obtained by assigning weights to each edge pixel based on the gradient magnitude of the edge pixels.

[0035] Optionally, the inverse residual block includes a convolutional layer for expanding the channel dimension, a depthwise separable convolutional layer for extracting spatial features, and a convolutional layer for compressing the channel dimension.

[0036] Optionally, before dividing the channels of the deep features into several groups and performing convolution on the features of each group of channels, the method further includes:

[0037] Dimensionality reduction of deep features is achieved through convolution operations.

[0038] Embodiments of the present invention also provide an underwater target detection system, comprising:

[0039] The image acquisition module is used to acquire underwater multibeam forward-looking sonar (MFLS) images;

[0040] The first feature extraction module is used to input the MFLS image into the trained underwater target detection model and extract features from the MFLS image at different scales and depths to obtain shallow, medium and deep features of the MFLS image at different scales.

[0041] The second feature extraction module is used to divide the channels of deep features into several groups, convolve the features of each group of channels, and rearrange the features of each group of channels after convolution so that the features of each group of channels after convolution can interact to obtain global features.

[0042] The third feature extraction module is used to extract local features from different receptive fields of deep features, and to fuse the local features of different receptive fields with global features to supplement the local details of global features in order to obtain the target deep features of the MFLS image.

[0043] The target detection module is used to perform underwater target detection on MFLS images based on shallow, mid-level and deep target features.

[0044] Embodiments of the present invention also provide a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described underwater target detection method.

[0045] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described underwater target detection method.

[0046] The underwater target detection method provided by this invention has at least the following beneficial effects:

[0047] By inputting underwater sonar images (i.e., MFLS images) into a trained underwater target detection model, the model extracts features at different depths from the MFLS images: shallow, mid-level, and deep features. The feature scales extracted for each of these three layers are also different. For deep features, a combination of grouped convolution and channel reorganization operations is used (dividing the deep feature channels into several groups, convolving the features of each group, and rearranging the features of each group after convolution to allow for interaction). Grouped convolution reduces computational and memory access costs, enabling the model to run efficiently in resource-constrained scenarios. Channel reorganization promotes feature fusion between groups, mitigating the information silos that might result from grouped convolution, thereby enhancing the ability to extract long-distance dependencies and obtaining global features. To supplement local details in the global features, such as the target's boundary and shape, local features from different receptive fields of the deep features are also extracted.

[0048] Underwater target detection is performed based on the features obtained from the above operations. Compared with strategies that use single-scale or shallow feature fusion, this approach combines multi-scale features and local detail information and global semantic information of MFLS images, which can improve the feature extraction capability of MFLS images and thus improve the accuracy of underwater target detection. Attached Figure Description

[0049] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0050] Figure 1This is a flowchart illustrating an underwater target detection method provided by the present invention.

[0051] Figure 2 This is a schematic diagram of a Lightweight-YOLOv8 network structure provided by the present invention;

[0052] Figure 3 This is a schematic diagram of a YOLOv8 network structure;

[0053] Figure 4 A schematic diagram of a module structure for Lightweight-YOLOv8 provided by the present invention;

[0054] Figure 5 A schematic diagram of the appearance and working principle of a device provided by the present invention;

[0055] Figure 6 A schematic diagram of an experimental environment and a simulated target used in the experiment is provided for this invention;

[0056] Figure 7 This invention provides a schematic diagram of the detection results of Lightweight-YOLOv8 on the USI dataset. Figure 1 ;

[0057] Figure 8 This invention provides a schematic diagram of the detection results of Lightweight-YOLOv8 on the USI dataset. Figure 2 ;

[0058] Figure 9 This invention provides a schematic diagram of the detection results of Lightweight-YOLOv8 on the USI dataset. Figure 2 . Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0060] The current methods for underwater target detection include the following:

[0061] i. Solution 1: Underwater target detection is an important aspect of monitoring aquaculture resources to protect marine ecosystems. In most cases, low light and scattered light conditions pose challenges to computer vision-based underwater target detection. To address these issues, this solution investigates underwater image color enhancement techniques, proposing a color enhancement technique to improve the visibility of small, numerous, and densely packed objects, followed by underwater object detection using YOLOv4. The main features of this underwater image color enhancement technique are the use of convolutional streams to extract multiple features, feature fusion to facilitate information flow, and the preservation of contextual information by discarding irrelevant features and enhancing color through appropriate feature selection.

[0062] Limitations: 1. Using YOLOv4 as the detector makes the model relatively heavy and difficult to deploy on resource-constrained underwater platforms. 2. The lack of full utilization of multi-scale feature fusion limits its ability to perceive weak targets in complex backgrounds. The loss function still uses the traditional IoU series, which is difficult to accurately characterize blurred boundaries in sonar images.

[0063] ii. Solution 2: Due to limitations such as the complex underwater environment, low resolution of sonar image data, and small sample size, traditional image recognition algorithms struggle to accurately identify sonar images. This solution, based on YOLOv7, designs a novel fast recognition model for sonar images—the dual-attention mechanism YOLOv7 model. To address the issue of insufficient sonar image samples, a transfer learning approach is employed. The model is pre-trained on a large-scale underwater acoustic target detection dataset to obtain initial weights, and then fine-tuned on a smaller, general-purpose sonar target detection dataset, thereby reducing the risk of overfitting.

[0064] Limitations: 1. The proposed model structure is too complex, resulting in excessive time and computational resource costs, making it inefficient for handling large-scale datasets. 2. The model has high requirements for datasets and poor adaptability to new targets. 3. The detection performance is not ideal when dealing with sonar images with complex backgrounds and blurred content.

[0065] iii. Solution 3: MFLS plays a crucial role in underwater target detection, but research on MFLS in underwater target detection faces the following challenges: First, there is a lack of available datasets; second, considering human visual habits, sonar images are typically processed at the pixel level and converted into a fan-shaped representation. To address these challenges, this solution proposes a new dataset—the Underwater Acoustic Target Detection Dataset—consisting of over 9000 MFLS images captured by sonar. This dataset provides the raw data of the sonar images and labels 10 target object classes. To validate the practicality of this dataset, it is applied to state-of-the-art detection models, and corresponding accuracy and efficiency benchmarks are provided.

[0066] Limitations: 1. Limited number of contrasting models makes it difficult to prove the dataset's practicality. 2. The contrasting models used are complex, requiring a large number of parameters, making it difficult to train and deploy on platforms with high real-time requirements using the constructed dataset. 3. Blurred edges in sonar images are not preprocessed, affecting the model's final detection performance.

[0067] Therefore, in the existing target detection methods of this invention: (1) the number of parameters is large and the inference speed is slow, making it difficult to deploy on UUVs with limited computing resources; (2) the ability to identify low-contrast, small targets or targets with blurred boundaries is insufficient; (3) the ability to perceive edge regions is weak, especially in sonar images, where the object edges are blurred, resulting in inaccurate target box positioning.

[0068] To address the issues of large model parameter count, slow inference speed, and difficulty in deployment on computationally limited UUVs, this invention proposes a lightweight C2F module. This module significantly reduces the number of model parameters while maintaining feature representation capabilities, thereby improving the flexibility of model deployment and inference speed. To address the problem that single-scale or shallow feature fusion strategies cannot effectively combine local detail information with global semantic information, resulting in insufficient recognition of low-contrast and blurred-boundary targets, this invention proposes a multi-feature fusion strategy. This significantly improves the detection capability of weak targets in sonar images and enhances the model's adaptability to low-quality images. Furthermore, to address the issue that the CIoU loss function mainly focuses on the overlap and center distance of target boxes but has weak perception of edge regions in sonar images, this invention proposes an edge-aware CIoU loss function. This enhances the model's perception of blurred edge targets and improves the accuracy of target box localization.

[0069] The technical solutions provided by the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0070] One embodiment of the present invention relates to an underwater target detection method. The specific process of the underwater target detection method in this embodiment can be as follows: Figure 1 As shown, it includes:

[0071] Step 101: Acquire underwater multibeam forward-looking sonar (MFLS) images.

[0072] Step 102: Input the MFLS image into the trained underwater target detection model, and extract features from the MFLS image at different scales and depths to obtain shallow, mid-level and deep features of the MFLS image at different scales.

[0073] Step 103: Divide the deep feature channels into several groups, perform convolution on the features of each group of channels, and rearrange the features of each group of channels after convolution so that the features of each group of channels interact to obtain global features.

[0074] Step 104: Extract local features from different receptive fields of the deep features, and fuse the local features of different receptive fields with the global features to supplement the local details of the global features in order to obtain the target deep features of the MFLS image.

[0075] Step 105: Detect underwater targets in the MFLS image based on its shallow, medium, and deep features.

[0076] The implementation details of the underwater target detection system in this embodiment are described below. The following content is only for the convenience of understanding and is not necessary for implementing this solution.

[0077] MFLS image detection for UUVs is of great significance in underwater exploration, ocean monitoring, and target recognition. However, sonar images are often accompanied by low signal-to-noise ratios, complex backgrounds, and blurred target features, posing a significant challenge to target detection. To address this, models need to be sensitive not only to detailed information but also to extract robust global features in complex backgrounds, balancing computational efficiency and resource constraints.

[0078] YOLOv8, as a powerful version of the YOLO series, combines efficiency and real-time performance, demonstrating excellent performance in many object detection tasks. However, given the characteristics of MFLS images, YOLOv8 still has certain limitations. First, its backbone module is insufficient in extracting detailed features from complex backgrounds and is susceptible to noise interference. Second, the C2F module used in its deep feature extraction module has high computational overhead, making it unsuitable for embedded platforms and resource-constrained environments. Furthermore, YOLOv8 does not fully integrate local and global functions, lacking the ability to model global information. Finally, its loss function cannot effectively incorporate environmental awareness information during bounding box regression, affecting fitting accuracy.

[0079] To address the aforementioned limitations, this embodiment proposes Lightweight-YOLOv8 (i.e., the network structure of the underwater target detection model in this embodiment) to improve the performance of YOLOv8 in MFLS image detection. The structure of Lightweight-YOLOv8 in this embodiment is as follows: Figure 2 As shown, Lightweight-YOLOv8 consists of three main parts: Backbone, Neck, and Head.

[0080] Part One, Backbone:

[0081] The lightweight-YOLOv8 backbone employs a layered design, focusing on improving the efficiency and accuracy of feature extraction. In the shallow feature extraction layer, YOLOv8 is retained (the structure of YOLOv8 is as follows...). Figure 3The original Convolutional-Batch Normalized-Sigmoid Linear Unit (CBS) module (as shown) is used to capture fine-grained information in images, especially suitable for detecting small targets. The input image size is (640, 640, 3). After processing by two CBS modules, the feature map sizes become (320, 320, 64) and (160, 160, 128), respectively. Then, in order to further reduce the complexity and computational cost of the model while maintaining high detection accuracy, this embodiment enhances the original C2F module in YOLOv8 and proposes a lightweight C2F (LWC2F) module. The original C2F module achieves efficient feature extraction through cross-level partial connections and feature fusion, but its Bottleneck structure has high computational cost and a large number of parameters. This embodiment adopts a lightweight design, replacing the Bottleneck in the C2F module with an inverse residual block, resulting in the lightweight C2F (LWC2F) module. This operation greatly reduces the computational cost while retaining key feature information. These shallow features contain rich edge and texture information, providing a foundation for subsequent feature fusion.

[0082] In YOLOv8, the CBS module is the cornerstone of the entire network. The lightweight design of the CBS module balances detection performance and inference speed, making YOLOv8 widely applicable to tasks with high real-time requirements. The CBS module consists of three core components: convolution, batch normalization, and the SiLU activation function. Convolutional layers extract local spatial features from the input feature map, with the receptive field controlled by convolutional kernels of varying sizes. Batch normalization layers normalize the feature map output by the convolutions to reduce the effects of offset and scaling. In YOLOv8, batch normalization is introduced primarily to stabilize network training, avoid gradient explosion or vanishing gradients, and accelerate convergence. The SiLU activation function introduces non-linearity, preserving negative gradient information less than zero, thereby improving the model's expressiveness and gradient fluidity. The SiLU activation function is defined as:

[0083] .

[0084] The LWC2F module retains the multi-level characteristics of the original C2F module, but its structure has been significantly adjusted. Specifically, the LWC2F module first processes the input features through a standard convolutional layer, then divides the features into two parts. One part extracts deep features through a lightweight inverse residual block, while the other part directly preserves the integrity of shallow features through short connections. After processing, the two parts are fused using Concat. Finally, a 1×1 convolution is used to further integrate inter-channel information to generate the final output features. The inverse residual block is the core module of MobileNetV2. Its design philosophy is to extract features by expanding dimensions and then recover the original dimensions through layer-by-layer compression. This module includes 1×1 convolutions for expanding channel dimensions, depthwise separable convolutions for extracting spatial features, and 1×1 convolutions for compressing channels. This design significantly reduces parameters and computational costs, making the module very suitable for real-time detection. The structures of the inverse residual block and LWC2F are as follows: Figure 4 (a) and Figure 4 As shown in (b) of the diagram.

[0085] In the mid-level feature extraction section, Lightweight-YOLOv8 replaces the original C2F module in YOLOv8 with the ShuffleNetV2 module. ShuffleNetV2 not only effectively reduces computational costs but also maintains strong feature extraction capabilities. In mid-level feature extraction of sizes (80, 80, 256) and (40, 40, 512), ShuffleNetV2 significantly improves computational efficiency through its lightweight design, making it very suitable for resource-constrained scenarios. The structure of the ShuffleNetV2 module is as follows: Figure 4 As shown in (c), ShuffleNetV2 is designed with grouped convolutions and channel shuffling to fully extract global features while maintaining computational efficiency.

[0086] In the deep feature extraction section, this embodiment proposes a Multiple Feature Fusion (MFF) strategy that combines local and global features. First, the SPPF module is used to extract deep local features, outputting a feature map of size (20, 20, 512). Then, a 1×1 convolution is used to reduce the feature map to (20, 20, 256), and ShuffleNetV2 is used to extract global features. The local and global features are then fused into a feature map of size (20, 20, 256) using a Concat operation. Finally, a 1×1 convolution is used to restore the dimensionality to form the final feature output.

[0087] Combination Figure 3 , Figure 4As can be seen from the above description, the Backbone of this embodiment includes: a shallow feature extraction module composed of a CBS module and an LWC2F module, a mid-level feature extraction module composed of a CBS module and a ShuffleNetV2 module, and a deep feature extraction module composed of a CBS module and an LWC2F module; the CBS module can extract features at the corresponding scale of the shallow feature extraction module, the mid-level feature extraction module, or the deep feature extraction module; the LWC2F module obtains shallow features or deep features by processing the features output by the CBS module of the shallow feature extraction module or the deep feature extraction module; the ShuffleNetV2 module extracts the global features of the features output by the CBS module of the mid-level feature extraction module as mid-level features.

[0088] For deep features, after processing by the corresponding CBS and LWC2F modules, the MFF strategy further enhances the feature representation capability. In the UUV MFLS image detection task, features at different scales are of great significance for target recognition. Shallow features contain rich boundary information, which is helpful for detecting small targets. Deep features contain higher-level semantic information and are suitable for detecting large targets. Due to the low resolution and noise interference of sonar images, it is difficult to comprehensively represent target information with a single feature expression. To this end, this invention proposes an MFF strategy that integrates global feature extraction and local feature enhancement to improve the detection performance of the model in complex underwater environments. The core concept of the MFF strategy is to obtain a more comprehensive representation of target features by fusing information from different scales and receptive fields. This strategy introduces global feature extraction and local feature enhancement into deep feature processing and enhances the detection effect through an efficient fusion method.

[0089] The MFF strategy can be described as follows:

[0090] Part 1, Input and Dimensionality Reduction:

[0091] Deep feature maps contain a large amount of semantic information, but direct processing would incur high computational costs. Therefore, we first reduce the number of channels from 512 to 256 using 1×1 convolutions to obtain reduced feature maps. This operation not only preserves the main semantic information but also significantly reduces costs, as shown in the following formula:

[0092] ;

[0093] In the formula, This refers to deep features (before the MFF strategy is implemented).

[0094] Part Two, Global Feature Extraction:

[0095] In MFLS images, targets may be obscured by complex background noise or underwater targets, but global contextual information is crucial for accurate target recognition. This embodiment uses the lightweight ShuffleNetV2 module to extract dimensionality-reduced global features and generate a global feature map. ShuffleNetV2 is designed with grouped convolutions and channel shuffling to fully extract long-range dependencies while maintaining computational efficiency.

[0096] .

[0097] Part Three, Local Feature Enhancement:

[0098] To supplement local details in the global features, especially to improve the ability to describe target boundaries and shapes, this embodiment uses the Spatial Pyramid Pooling Fast (SPPF) module to process deep feature maps. SPPF captures local features from different receptive fields through multi-scale max pooling operations, generating locally enhanced features. See the structure of the SPPF module. Figure 2 In (d), the operation is as follows:

[0099] .

[0100] Part Four, Feature Fusion:

[0101] Global and local features are concatenated according to the channel dimension to generate fused features. Then, a 1×1 convolution is used to restore the fused features to their original number of channels, producing the final deep feature output. This is used for subsequent target classification and regression, as shown in the following formula:

[0102] ;

[0103] ;

[0104] By employing dimensionality reduction and lightweight module design, the MFF strategy effectively reduces the computational complexity of deep feature processing, enabling Lightweight-YOLOv8 to run efficiently in embedded devices and real-time detection tasks.

[0105] Part Two: Neck

[0106] The Neck module further interacts and fuses multi-scale features to enhance the detection performance of targets of different sizes. The Lightweight-YOLOv8 Neck adopts a lightweight design. In the feature transfer stage, the Neck undertakes the key task of connecting the Backbone and Head. Its core role is to fuse multi-scale feature maps to enhance the model's ability to detect targets of different scales.

[0107] Specifically, Neck's input includes feature maps from three different resolution levels from the Backbone: shallow, mid-level, and deep features. To balance high-level semantic information with low-level edge details, Neck employs both bottom-up and top-down bidirectional feature fusion paths. In terms of structural design, each feature fusion unit in Neck uses an LWC2F module to replace the original C2F structure in YOLOv8. This replacement significantly reduces computational costs while ensuring sufficient feature expressiveness. For low-resolution feature maps, nearest-neighbor interpolation is used for upsampling to recover spatial information; for high-resolution feature maps, downsampling is achieved through 3×3 convolutions with a stride of 2 during downsampling to align scale. Then, feature concatenation along the channel direction is performed before being input into the LWC2F module for fusion and enhancement. This structural design effectively improves the perception of small targets and blurred boundaries while maintaining a balance between structural compactness and computational efficiency.

[0108] Part Three: Head

[0109] The Head module is responsible for the final object detection task, including class prediction and bounding box regression. Lightweight-YOLOv8 adopts the detector design of YOLOv8 and is efficiently connected to the improved Backbone and Neck, outputting object class distribution and bounding box information through the classification head and regression head, respectively.

[0110] In addition, the loss function of the underwater target detection model in this embodiment includes a first loss function and a second loss function; wherein, the first loss function is constructed based on the degree of matching between the predicted box and the ground truth box, and the second loss function is constructed based on the degree of influence of the edge information of the MFLS image on the degree of matching between the predicted box and the ground truth box.

[0111] In MFLS image detection tasks, sonar images often exhibit characteristics such as blurred target boundaries, complex backgrounds, and diverse target shapes. Traditional regression loss functions have some shortcomings in handling this specific task: (1) The IoU loss function only focuses on the geometric overlap between the predicted box and the real box, while ignoring the edge information of the target. In sonar images, the boundary between the target and the background is usually blurred, and ignoring the edge will lead to inaccurate description of the real target during the regression process. (2) In complex sonar scenes, there may be background noise, obstacles, and similar non-target areas around the target. The regression quality of the predicted box will be significantly affected by these environmental factors, and the CIoU loss function fails to consider these effects. To address these shortcomings, this invention proposes the EACioU loss function, which improves the detection performance of the model in complex underwater sonar environments by introducing an edge-aware term. The implementation process of the EACioU loss function is as follows:

[0112] IoU is a widely used loss function in object detection tasks, defined as the ratio of the intersection area between the predicted bounding box and the ground truth bounding box to their joint area.

[0113] ;

[0114] Based on this, the CIoU loss function (i.e., the first loss function) is defined as:

[0115] ;

[0116] ;

[0117] ;

[0118] ;

[0119] In the formula, Let be the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box, and let c be the minimum diagonal length of the bounding box containing both the predicted and ground truth bounding boxes. and These are the predicted bounding box and the ground truth bounding box, respectively. The width of the actual bounding box. The actual height of the bounding box. The width of the prediction box. The height of the predicted bounding box, v It is a measure of aspect ratio consistency. It is the weighting coefficient.

[0120] To improve the sensitivity of the loss function to target boundaries, this embodiment introduces an edge-aware term (i.e., a second loss function) into the loss function. Edge information is particularly important for target detection, especially in sonar images where target boundaries are blurred and background noise is complex. This invention uses the classic Canny edge detection algorithm to extract edge features from the predicted bounding box and the ground truth bounding box. For each frame of the sonar image, the detection algorithm extracts edge features through the following steps:

[0121] (1) Gaussian smoothing: After inputting a grayscale image, a Gaussian filter is used to remove noise to obtain a smooth image. Since the original sonar image often contains noise, if edge detection is performed directly, noise points are easily misidentified as edges. Therefore, a Gaussian filter is used to blur the image, which can effectively smooth noise interference while preserving the main image structure, thus providing a more stable input for subsequent gradient calculation.

[0122] The Gaussian filter equation is as follows:

[0123] ;

[0124] In the formula, x , y It represents the horizontal and vertical coordinate offsets of the current pixel relative to the center of the Gaussian kernel. It is the standard deviation, used to control the width of the distribution.

[0125] (2) Gradient calculation: The Sobel operator is used to calculate the horizontal and vertical gradients of an image. and The purpose of this step is to identify the regions in the image with the most dramatic grayscale changes—that is, edge candidate regions. By using the Sobel operator to calculate the gradient of the image in the horizontal and vertical directions, the gradient magnitude (i.e., edge intensity) and gradient direction (i.e., the orientation of the edge) of each pixel are then calculated.

[0126] The gradient G is calculated using the following formula:

[0127] ;

[0128] ;

[0129] 3) Non-maximum suppression: Suppresses the gradient magnitude along the gradient direction, retaining only local maxima to ensure edge refinement. "Refining" the edges means retaining only the true edge centerline. Specifically, for each pixel, the gradient magnitude of neighboring pixels is checked along its gradient direction. Only if the current pixel is a local maximum is it retained; otherwise, it is suppressed to 0. This strategy effectively removes redundant and blurry edge information, making edges clearer and more precise.

[0130] (4) Dual threshold detection: Set a high threshold and a low threshold to distinguish between strong edges and weak edges. In this step, a high threshold and a low threshold are set to divide pixels into three categories according to their gradient magnitude: strong edges (above the high threshold), weak edges (between the high and low thresholds), and non-edges (below the low threshold). This can initially filter out obvious edge regions, while retaining some "candidate pixels" that may be real edges but whose gradients are not strong enough.

[0131] (5) Edge Connection: Strong edges are retained directly as edges. Weak edges are only retained as edges when connected to strong edges; otherwise, they are deleted. This step is used to finally determine whether weak edge pixels should be retained. The specific strategy is: if a weak edge pixel is directly connected to a strong edge pixel, it is retained as a real edge; otherwise, it is deleted. This "strong-to-weak" approach can effectively eliminate isolated pixels caused by noise while maintaining edge continuity, improving the reliability and integrity of the edge map.

[0132] (6) Feature Output: Assign weights to edge pixels based on the edge detection results. After obtaining the edge weight matrix, the calculation formula for the edge perception term is:

[0133] ;

[0134] In the formula, The weights of each edge pixel in the MFLS image. N The number of edge pixels. This is the weight matrix for the edge pixels of the MFLS image.

[0135] Edge weight matrices help guide the model to focus more on target boundaries, thereby enhancing its ability to detect targets with blurred edges. In target boundary regions, lower IoU leads to higher weights, guiding the model to pay more attention to target edges. Weighted summation can comprehensively evaluate the model's attention to all target edges, rather than just a single target.

[0136] After incorporating the edge-aware term into the original CIoU loss function, the EACioU loss function (i.e., the loss function of the underwater target detection model) is calculated as follows:

[0137] ;

[0138] In the formula, is a weight parameter used to control the influence of the second loss function on the loss function of the underwater target detection model.

[0139] The technical effects of the underwater target detection method of the present invention are illustrated below with a specific experimental simulation example:

[0140] (1) Experimental dataset:

[0141] i. Recording devices:

[0142] MFLS is an advanced underwater detection device that utilizes multibeam sonar technology to generate high-resolution images with a wide field of view through a receiving array and digital signal processing after a single sound wave is emitted. This type of device is widely used in underwater navigation, topographic surveying, and target detection. Unlike traditional mechanical sonar, multibeam sonar has no moving parts and can generate sonar images in real time, avoiding image distortion caused by mechanical scanning. Its unique forward-looking capability allows the operator to intuitively understand the environment ahead of the waterline and provides crucial collision avoidance and navigation support, which is especially important in complex or unknown waters.

[0143] As a typical representative of MFLS technology, the M750d is a high-performance device designed specifically for underwater exploration and fine imaging. It employs a dual-frequency operating mode, balancing wide-area searching and high-resolution imaging. The M750d not only boasts powerful imaging capabilities but also stands out for its flexible operation and robust design. The device supports a maximum operating depth of 500 meters and weighs only 360 grams in water. Built-in water pressure and temperature sensors allow for real-time adjustment of sound velocity, ensuring data accuracy. Users can utilize ViewPoint software for real-time image display, data recording and playback, and adjust various parameters such as gain, frequency, and color palette to optimize imaging effects. Therefore, the M750d MFLS was used for image data acquisition experiments on the Underwater Sonar Image (USI) dataset. The main parameters of the M750d are shown in Table 1, and its appearance and operating principle are described below. Figure 5 As shown.

[0144] Table 1 Main parameters of M750d

[0145]

[0146] ii. Data acquisition equipment:

[0147] Given the complexity and diversity of marine environments, collecting high-quality and representative data for model training and validation is crucial. Therefore, to meet the needs of various UUV tasks, including target detection, scene classification, and target localization, this embodiment constructs an MFLS dataset: the USI dataset, which contains various simulated targets and environments. All data in this dataset were collected at a scientific experimental field in Hebei Province. The experimental environment and simulated targets used in the experiments are as follows: Figure 6 As shown.

[0148] During the experiment, the M750d was initially fixed to a rigid support on the shore of the experimental site and submerged in water. After being powered on, the M750d operated normally at a frequency of 1.2 MHz. Then, a sphere and an Autonomous Underwater Vehicle (AUV) model were secured to a floating platform using Kevlar ropes. The target's submersion depth was controlled to ensure it was clearly visible in the control software. Finally, the target was repositioned by adjusting the sonar's detection range and maneuvering the floating platform, collecting sonar images of the target at different distances and orientations. After each acquisition, the recorded data, including sonar echo images of different targets, was exported, analyzed, and processed. The M750d's operating frequency was adjusted to 750 kHz, and the same method was used to experiment on all models.

[0149] iii. Data collection and preprocessing:

[0150] This embodiment uses the Oculus M750d MFLS device for data collection. Designed specifically for underwater missions, this device features real-time imaging, high resolution, and multi-beam technology, generating high-quality underwater sonar images and providing robust data support for underwater target detection. The M750d supports dual-frequency operation: a low-frequency mode of 750kHz and a high-frequency mode of 1.2MHz. During operation, the device transmits sound waves into the water and receives the echoes reflected from underwater targets. The target distance is then calculated based on the sound wave propagation time, and the echo intensity is mapped to a sonar image. This process is handled by the device's beamforming algorithm, generating 512 independent beams and producing high-quality images at up to 40 frames per second. During transmission and reception, the sonar device automatically compensates for changes in sound speed caused by variations in water salinity, temperature, and depth. Integrated sensors monitor these parameters in real time to ensure the accuracy of distance measurements and imagery.

[0151] During data acquisition, the sonar was configured using the ViewPoint software included with the device. This software supports real-time viewing and storage of data and allows adjustment of key parameters (such as gain, range, and frequency) to adapt to different environmental conditions. The collected data is stored as Oculus format files containing timestamp information.

[0152] To ensure the acquired sonar data can be effectively used for model training, this invention preprocesses the raw sonar data. First, the collected Oculus files are converted into BIN files, and then further converted into JPG files. Next, the image files are labeled in JPG format, and the labeled files are exported in XML format. During the labeling process, images with poor imaging quality and unidentifiable targets are removed. A total of 4313 images are obtained, including 1456 images of the torpedo model, 1686 images of the sphere, and 1171 images of the AUV model. The final dataset is named the USI dataset. Furthermore, during model training, the dataset is first divided into training and test sets at a 9:1 ratio. Subsequently, the training set is further divided into training and validation sets at a 9:1 ratio.

[0153] (2) Parameter settings:

[0154] During model training, parameter settings directly affect convergence speed and final performance. To maximize the model's ability to achieve optimal results, this invention fine-tunes key parameters based on data characteristics and task requirements. Since the input size of YOLOv8 is 640×640, the image size is automatically adjusted before Lightweight-YOLOv8 training to ensure the input image participates properly in training. To improve the model's generalization ability and prevent overfitting, mosaic and mixup methods are used to augment the input image. The main parameter settings for Lightweight-YOLOv8 are shown in Table 2.

[0155] Table 2 Main parameter settings for Lightweight-YOLOv8

[0156]

[0157] To verify the superior performance of Lightweight-YOLOv8 in sonar image detection, this invention uses several mainstream detection models as comparison models, including Faster R-CNN, Center Net, YOLOv4, YOLOv5, YOLOv7, YOLOv7 tiny, and YOLOv8. The backbone networks and parameter settings of these mainstream detection models are shown in Table 3.

[0158] Table 3. Backbone network and parameter settings of mainstream detection models

[0159]

[0160] (3) Evaluation indicators:

[0161] In the MFLS image detection task, to comprehensively evaluate the performance of Lightweight-YOLOv8, this experiment adopted a set of commonly used evaluation metrics. These metrics cover the evaluation of detection accuracy, object capture capability, model complexity, and computational efficiency, and can analyze the model from different dimensions. These evaluation metrics include Precision, Recall, F1, mAP@0.5, Params, and GFLOPS, and their calculation methods are as follows:

[0162] i. Precision:

[0163] Precision represents the ratio of correctly predicted positive samples to the total number of predicted positive samples, indicating the model's accuracy in identifying positive targets.

[0164] ;

[0165] In the formula, TP and FP These represent the target number of positive samples that were correctly and incorrectly detected, respectively.

[0166] ii. Recall:

[0167] Recall represents the proportion of actual positive samples that were correctly predicted as positive, highlighting the model's ability to capture positive samples.

[0168] ;

[0169] In the formula, FN It is the number of target samples that are actually positive but were not detected.

[0170] iii. F1:

[0171] F1 is the harmonic mean of Precision and Recall, serving as a combined metric for Precision and Recall in a balanced model.

[0172] .

[0173] iv. mAP@0.5:

[0174] mAP@0.5 is a key metric for object detection, used to evaluate the overall performance of the model at different detection thresholds. It calculates the average precision across all classes, which is the area under the precision-recall curve when the IoU threshold is set to 0.5.

[0175] ;

[0176] In the formula, This is the Precision-Recall curve, where n is the number of categories.

[0177] v. Params and GFLOPS:

[0178] Params represent the total number of trainable parameters in a model, serving as an indicator of its complexity. GFLOPS measure the computational workload of a model, representing the number of floating-point operations performed per second during training. The lower the GFLOPS, the more suitable the model is for resource-constrained hardware environments.

[0179] (4) Comparative experiment:

[0180] i. Based on different datasets:

[0181] To fully validate the detection performance of the Lightweight-YOLOv8 model in different scenarios, this invention selected several representative datasets as experimental benchmarks. These datasets cover various application scenarios, including underwater target detection, ship target detection, and MFLS image detection tasks. Through experiments on different datasets, the performance of Lightweight-YOLOv8 in handling diverse image features and detecting complex targets can be evaluated, and its robustness and applicability in real-world environments can be verified. The datasets selected for this experiment are URPC2021, Seaships, TRASH-ICRA19, SCTD, and UATD, which are described in detail below. The detection results of Lightweight-YOLOv8 based on different datasets are shown in Table 4. The detection results and loss curves of Lightweight-YOLOv8 on the USI dataset are shown in Table 4. Figures 7 to 9 As shown.

[0182] 1. URPC2021 dataset:

[0183] URPC2021 is a dataset specifically designed for underwater target detection and segmentation, widely used in underwater robotics research. The dataset consists of images collected from real underwater scenes, encompassing various complex underwater environments with different lighting conditions, turbidity, and occlusion, fully reflecting the actual challenges of underwater tasks. It mainly includes four target categories: sea cucumbers, spiny seabream, scallops, and starfish, and provides annotation information for each target.

[0184] 2. Seaships dataset:

[0185] Seaships is a large-scale, precisely labeled ship detection dataset designed to support object detection research in the field of computer vision. The dataset contains 31,455 images covering six categories of ships. Furthermore, it features diverse characteristics, encompassing varying weather, lighting, backgrounds, sizes, and the number of targets, resulting in highly complex scenes. It is suitable for tasks such as ship detection and image segmentation, helping researchers address the challenges of ship detection in real-world scenarios.

[0186] 3. TRASH-ICRA19 dataset:

[0187] TRASH-ICRA19 contains 1144 images and their corresponding labels, making it ideal for maritime target detection missions. The dataset includes three classes: plastic, bio, and rov, labeled in PASCAL VOC format, facilitating direct training and evaluation of target detection models. Furthermore, the relatively balanced amount of data across classes prevents training problems caused by data imbalance and enhances the model's generalization ability.

[0188] 4. SCTD dataset:

[0189] SCTD is a multi-class public dataset designed for target detection tasks in sonar images. This dataset contains 497 high-resolution sonar images, covering three imaging modes: side-scan sonar, forward-looking sonar, and interferometric synthetic aperture sonar. The dataset contains 596 targets, categorized into three classes: shipwrecks (461 targets), aircraft (90 targets), and humans (45 targets). SCTD's data annotations have undergone several rounds of manual annotation to reduce human error, and both Pascal VOC and MS COCO data formats are provided for further learning.

[0190] 5. UATD dataset:

[0191] UATD is a high-quality dataset specifically designed for MFLS image detection, covering ten target categories including cubes, spheres, cylinders, cages, and Bluerov targets, with a total of 9200 labeled images. The dataset was collected by MFLS equipment, and the sampling environment covers various complex underwater scenarios such as lakes and shallow waters, fully considering noise interference and environmental diversity in practical applications. UATD provides raw sonar echo intensity data, preserving the integrity and realism of the data, making it suitable for model performance evaluation and underwater target detection research.

[0192] Table 4 Lightweight-YOLOv8 detection results based on different datasets

[0193]

[0194] Table 4 shows that the performance of Lightweight-YOLOv8 on multiple datasets validates the effectiveness of its innovative modules. By introducing a lightweight network, this model achieves efficient multi-scale feature extraction in complex scenes, significantly improving detection accuracy while maintaining low computational cost. The application of the MFF strategy effectively enhances the model's ability to identify weak targets, particularly on the UATD and USI datasets, where accuracy reaches 97.47% and 98.45%, respectively. The EACioU loss function further optimizes target localization accuracy, resulting in an mAP@0.5 exceeding 95% on multiple datasets, reaching 99.57% and 98.70% on the Seaships and USI datasets, respectively. Furthermore, the development of the USI dataset provides a more realistic benchmark for underwater weak target detection, validating the model's robustness in high-noise and complex backgrounds.

[0195] Figure 7 The results show that the AP of the torpedo model is 98.04%, the AP of the sphere is 98.84%, and the AP of the AUV model is as high as 99.23%, demonstrating extremely high detection accuracy. From the shape of the curves, the precision and recall of the three targets maintain a high balance in most cases. Especially in the high recall region, the decrease in precision is very small, indicating that the model has strong noise resistance while maintaining high recall.

[0196] Figure 8 The results show that the F1 score for both the torpedo and AUV models is 0.96, while the sphere model has the highest F1 score at 0.98. Looking at the curve shape, the F1 scores for all three target types approach their maximum values ​​at low confidence thresholds, indicating that the model effectively balances precision and recall at low thresholds. As the confidence threshold increases, the F1 score gradually decreases and rapidly approaches zero at higher thresholds. In summary, when the threshold reaches approximately 0.5, these curves almost reach their highest point and become relatively flat. Therefore, choosing 0.5 as the threshold in this invention is reliable.

[0197] Figure 9 (a) shows the label distribution of the three categories in the test set. The ball has the most labels, followed by the AUV model and the torpedo model. Figure 9 (b) shows that the log-mean false negative rate for the three target categories is low, which indicates the model’s strong detection performance on sonar images. Figure 9 Figure (c) shows that after 50 training iterations, the loss curves of both the training and test sets stabilized, demonstrating the model's fast convergence and strong generalization ability. In conclusion, Lightweight-YOLOv8 exhibits high versatility and reliability in UUVMFLS image detection tasks.

[0198] ii. Mainstream detection models:

[0199] To evaluate the performance of Lightweight-YOLOv8, this experiment compared it with several mainstream detection models, including Faster R-CNN, CenterNet, YOLOv4, YOLOv5, YOLOv7, YOLOv7-Tiny, and YOLOv8. Faster R-CNN is a classic two-stage object detection model. It first uses a region proposal network to generate candidate regions, and then performs fine-grained classification and regression adjustments on each candidate region. In contrast, CenterNet is a single-stage detection model that identifies the center point of the object as a key feature and uses it to generate the object's bounding box. Compared to the two-stage model, it has higher detection speed and better detection accuracy. YOLOv4 achieves a good balance between detection speed and accuracy by optimizing the network structure, introducing data augmentation strategies, and improving the loss function. YOLOv5, as the successor to YOLOv4, further improves detection performance while maintaining lightweight design and higher computational efficiency. YOLOv7 is one of the latest products in the YOLO series. By proposing various optimization modules, the performance indicators of the YOLO series target detection in terms of accuracy and speed have been improved. YOLOv7 tiny is a lightweight version of YOLOv7, designed specifically for devices with limited resources. While maintaining a certain level of detection accuracy, it can significantly reduce model parameters and computational complexity. The detection results of different models are shown in Table 5.

[0200] Table 5 Detection results of different models

[0201]

[0202] As shown in Table 5, compared with mainstream object detection models, the proposed Lightweight-YOLOv8 demonstrates significant improvements across all metrics, with a precision as high as 98.45%. This is primarily due to the lightweight network structure reducing parameters and computational complexity, while the MFF strategy enhances the combination of local and global information, improving weak object detection capabilities. Furthermore, the EACioU loss function optimizes target boundary locations and ensures more accurate target frame regression. Overall, Lightweight-YOLOv8 achieves more accurate and robust object detection while maintaining high computational efficiency, validating its effectiveness and application potential in sonar image detection tasks.

[0203] iii. Ablation experiment:

[0204] To comprehensively evaluate the contribution of each improved module of Lightweight-YOLOv8 to the final detection performance, this experiment designed detailed ablation experiments. These experiments primarily focused on the lightweight network, the MFF strategy, and the EACIOU loss function, constructing baseline models with different module combinations and several variant models. Based on the baseline, the independent and synergistic effects of each module on model performance were analyzed by introducing specific modules individually. The detection results of the ablation experiments are shown in Table 6.

[0205] Table 6. Detection results of ablation test

[0206]

[0207] As shown in Table 6, Lightweight-YOLOv8 comprehensively optimizes traditional object detection models by introducing several innovative modules. The introduction of lightweight networks significantly reduces the model's parameters and computational complexity. Compared to the baseline model, Lightweight-YOLOv8's parameters decreased from 11.18M to 7.60M, and GFLOPS decreased from 12.92G to 7.53G. This improvement greatly reduces the model's resource requirements, making it more suitable for deployment in UUV devices with limited computing resources, while maintaining excellent detection performance. The introduction of the MFF strategy improves detection accuracy and robustness. The Base B model's accuracy increased to 94.65%, and mAP@0.5 increased to 94.17%, indicating that the MFF strategy effectively integrates multi-scale features and enhances adaptability to complex backgrounds and weak targets. After introducing EACioU, the recall and mAP@0.5 increased to 92.06% and 93.91%, respectively. This improvement alleviates the shortcomings of the CIoU loss function in target boundary regression. The final Lightweight-YOLOv8 integrates the above modules, and its overall performance is better than the individual improved versions, indicating that these improvements have a synergistic effect in improving model performance.

[0208] In summary, Lightweight-YOLOv8 achieves a balance between performance and efficiency in UUV sonar image detection by introducing lightweight design, feature fusion strategies, and the EACioU loss function. This model not only improves target detection capabilities in complex underwater environments but also significantly reduces computational and storage requirements, providing a novel technical solution for underwater weak target detection.

[0209] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the protection scope of this invention. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, without changing the core design of the algorithm and process, are also within the protection scope of this invention.

[0210] Another embodiment of the present invention relates to an underwater target detection system. The implementation details of this underwater target detection system are described below. The following details are provided for ease of understanding and are not essential for implementing this solution. The underwater target detection system of this embodiment includes:

[0211] The image acquisition module is used to acquire underwater multibeam forward-looking sonar (MFLS) images;

[0212] The first feature extraction module is used to input the MFLS image into the trained underwater target detection model and extract features from the MFLS image at different scales and depths to obtain shallow, medium and deep features of the MFLS image at different scales.

[0213] The second feature extraction module is used to divide the channels of deep features into several groups, convolve the features of each group of channels, and rearrange the features of each group of channels after convolution so that the features of each group of channels after convolution can interact to obtain global features.

[0214] The third feature extraction module is used to extract local features from different receptive fields of deep features, and to fuse the local features of different receptive fields with global features to supplement the local details of global features in order to obtain the target deep features of the MFLS image.

[0215] The target detection module is used to perform underwater target detection on MFLS images based on shallow, mid-level and deep target features.

[0216] It is not difficult to see that this embodiment is a system embodiment corresponding to the above method embodiments, and this embodiment can be implemented in conjunction with the above method embodiments. The relevant technical details and technical effects mentioned in the above embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above embodiments.

[0217] It is worth mentioning that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by this invention; however, this does not mean that other units are absent from this embodiment.

[0218] Another embodiment of the present invention relates to a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the underwater target detection methods described in the above embodiments.

[0219] In this embodiment, the memory and processor are connected via a bus, which can include any number of interconnected buses and bridges, connecting various circuits of one or more processors and the memory together. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be further described in this embodiment. A bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.

[0220] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.

[0221] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the method embodiments described above.

[0222] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0223] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing the present invention, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of the present invention.

Claims

1. A method for detecting underwater targets, characterized in that, The method includes: Acquire underwater multibeam forward-looking sonar (MFLS) images; The MFLS image is input into the trained underwater target detection model, and features at different scales and depths are extracted from the MFLS image to obtain shallow, medium and deep features of the MFLS image at different scales. The deep feature channels are divided into several groups, the features of each group are convolved, and the features of each group are rearranged after convolution to allow the features of each group to interact and obtain global features. Local features of different receptive fields in the deep feature extraction process are extracted and fused with global features to supplement local details of global features in order to obtain target deep features of the MFLS image. Underwater target detection is performed on MFLS images based on shallow, mid, and deep target features. The network structure of the underwater target detection model includes: a shallow feature extraction module consisting of a CBS module and an LWC2F module; a mid-level feature extraction module consisting of a CBS module and a ShuffleNetV2 module; and a deep feature extraction module consisting of a CBS module and an LWC2F module. The CBS module includes convolutional layers, batch normalization layers, and SiLU activation function layers to extract features at the corresponding scales of the shallow feature extraction module, the mid-level feature extraction module, or the deep feature extraction module. The LWC2F module processes the features output by the shallow or deep feature extraction module's CBS module through a convolutional layer. The processed features are divided into two parts. One part of the features is extracted again through an inverse residual block and then fused with the other part of the features from the short connections. The fused features are then integrated through a convolutional layer to obtain shallow or deep features. The ShuffleNetV2 module is used to extract global features from the CBS module output of the mid-layer feature extraction module, and use them as mid-layer features. The ShuffleNetV2 module extracts global features through grouped convolution and channel shuffling. The target deep features of the MFLS image are obtained in the following way: The deep features are reduced in dimensionality through convolution operations, and the global features of the reduced deep features are extracted using the ShuffleNetV2 module. The SPPF module extracts local features from different receptive fields of deep features, and then fuses these local features with global features to supplement local details of the global features, thus obtaining the target deep features.

2. The underwater target detection method according to claim 1, characterized in that, The loss function of the underwater target detection model includes a first loss function and a second loss function; The first loss function is constructed based on the degree of matching between the predicted bounding box and the ground truth bounding box, while the second loss function is constructed based on the influence of the edge information of the MFLS image on the degree of matching between the predicted bounding box and the ground truth bounding box.

3. The underwater target detection method according to claim 2, characterized in that, The loss function of the underwater target detection model is: ; In the formula, For the first loss function, For the second loss function, These are preset weight parameters used to control the impact of the second loss function on the loss function of the underwater target detection model; ; In the formula, The weights of each edge pixel in the MFLS image. N The number of edge pixels. This is the sum of the weights of all edge pixels in the MFLS image. for Loss function; ; ; ; ; ; In the formula, The distance between the center points of the predicted bounding box and the ground truth bounding box is the Euclidean distance. c The minimum diagonal length of the bounding box containing both the predicted and ground truth boxes. and These are the predicted bounding box and the ground truth bounding box, respectively. The width of the actual bounding box. The actual height of the bounding box. The width of the prediction box. This represents the height of the predicted bounding box.

4. The underwater target detection method according to claim 3, characterized in that, The weight matrix of the edge pixels of the MFLS image is obtained through the following steps: Denoising is performed on the grayscale image of the MFLS image to obtain a smooth image; Calculate the horizontal and vertical gradients of the smoothed image, and based on the horizontal and vertical gradients, obtain the gradient magnitude and gradient direction of each pixel in the smoothed image; For each pixel, the gradient magnitude of neighboring pixels is obtained along the gradient direction of the pixel. When the gradient magnitude of a neighboring pixel is a local maximum, the pixel is retained to refine the edges of the smooth image. The remaining pixels are divided into two categories, strong edge pixels and weak edge pixels, according to the gradient magnitude. Strong edge pixels are considered as edge pixels, and pixels in the weak edge pixels that are connected to strong edge pixels are also considered as edge pixels. The weight matrix of the edge pixels in the MFLS image is obtained by assigning weights to each edge pixel based on the gradient magnitude of the edge pixels.

5. The underwater target detection method according to claim 1, characterized in that, The inverse residual block includes a convolutional layer for expanding the channel dimension, a depthwise separable convolutional layer for extracting spatial features, and a convolutional layer for compressing the channel dimension.

6. An underwater target detection system, characterized in that, The system includes: The image acquisition module is used to acquire underwater multibeam forward-looking sonar (MFLS) images; The first feature extraction module is used to input the MFLS image into the trained underwater target detection model and extract features from the MFLS image at different scales and depths to obtain shallow, medium and deep features of the MFLS image at different scales. The second feature extraction module is used to divide the channels of deep features into several groups, convolve the features of each group of channels, and rearrange the features of each group of channels after convolution so that the features of each group of channels after convolution can interact to obtain global features. The third feature extraction module is used to extract local features from different receptive fields of deep features, and to fuse the local features of different receptive fields with global features to supplement the local details of global features in order to obtain the target deep features of the MFLS image. The target detection module is used to perform underwater target detection on MFLS images based on shallow features, mid-level features and deep target features of the MFLS images; The network structure of the underwater target detection model includes: a shallow feature extraction module consisting of a CBS module and an LWC2F module; a mid-level feature extraction module consisting of a CBS module and a ShuffleNetV2 module; and a deep feature extraction module consisting of a CBS module and an LWC2F module. The CBS module includes convolutional layers, batch normalization layers, and SiLU activation function layers to extract features at the corresponding scales of the shallow feature extraction module, the mid-level feature extraction module, or the deep feature extraction module. The LWC2F module processes the features output by the shallow or deep feature extraction module's CBS module through a convolutional layer. The processed features are divided into two parts. One part of the features is extracted again through an inverse residual block and then fused with the other part of the features from the short connections. The fused features are then integrated through a convolutional layer to obtain shallow or deep features. The ShuffleNetV2 module is used to extract global features from the CBS module output of the mid-layer feature extraction module, and use them as mid-layer features. The ShuffleNetV2 module extracts global features through grouped convolution and channel shuffling. The target deep features of the MFLS image are obtained in the following way: The deep features are reduced in dimensionality through convolution operations, and the global features of the reduced deep features are extracted using the ShuffleNetV2 module. The SPPF module extracts local features from different receptive fields of deep features, and then fuses these local features with global features to supplement local details of the global features, thus obtaining the target deep features.

7. A computer device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the underwater target detection method as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the underwater target detection method as described in any one of claims 1 to 5.