Target detection method for lightweight side-scan sonar shipwreck image
By building an improved YOLOv8 network model, combining weighted feature fusion and multi-scale convolution module, the balance problem of high-precision and rapid detection in side-sweep sonar technology is solved, and is suitable for underwater object detection.
Patent Information
- Application Number
- CN202510461100.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-08-01
AI Technical Summary
The existing side-sweep sonar technology cannot have both high precision and fast detection at the same time. The traditional method has low detection efficiency and is easily affected by subjective factors, while the deep learning method has high computational volume and is difficult to meet real-time needs.
Build an improved network model based on YOLOv8, including backbone improvement network, feature fusion improvement network and lightweight shared detection head, and adopts a weighted feature fusion mechanism, multi-scale convolution module and efficient upsampling module to reduce the amount of parameters and improve the feature fusion capability.
It realizes high-precision and rapid detection under limited computing resources, significantly reducing model complexity and improving detection accuracy and speed, and is suitable for real-time object detection of underwater autonomous vehicles.
Smart Images

Figure CN120411752A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image detection technology, and in particular to a target detection method for lightweight side-scan sonar shipwreck images. Background Art
[0002] With increasing marine activity, the precise detection and identification of underwater targets is crucial to many economic sectors. Underwater shipwreck identification, in particular, as a key technology in marine surveying, plays a crucial role in underwater archaeology, shipwreck detection and rescue, and river obstacle detection, directly impacting the progress and effectiveness of these exploration missions. Side-scan sonar, as an acoustic detection device, operates in low-visibility conditions and boasts long range and high efficiency. Leveraging its low cost and high resolution, it has become a key tool used by various countries to survey marine resources. Target detection in side-scan sonar images typically relies on manual interpretation, a process that faces numerous challenges: low computational efficiency, susceptibility to subjective factors, and various uncertain interference factors. Furthermore, in certain situations, such as when using autonomous underwater platforms as sonar carriers, manual interpretation is not possible. To overcome these difficulties, academic research has actively explored new methods and technologies for automatic target detection in side-scan sonar images. Specifically, these methods can be categorized as traditional approaches and those based on deep learning. Deep learning-based object detection methods have been a hot topic in recent years. These methods are categorized into two types: two-stage and single-stage. Representative algorithms include R-CNN, Faster R-CNN, DETR, and the YOLO series. While two-stage algorithms offer superior overall accuracy to traditional methods, they require candidate box selection and classification, requiring the training of multiple models, which impacts detection speed and makes it difficult to meet demanding requirements. While single-stage algorithms improve detection speed, they still require a high number of parameters and computational complexity. Practical deployment requires an algorithmic structure with lower parameter and computational complexity while maintaining high accuracy.
[0003] By analyzing the research on traditional methods and deep learning methods, it is found that in the research on target detection involving side-scan sonar images, there is either low detection accuracy or slow detection speed, and no balanced solution has been found between these two problems. Summary of the Invention
[0004] The present application provides a lightweight side-scan sonar target detection method for shipwreck images to solve the problem that existing side-scan sonar technology cannot achieve both high precision and fast detection at the same time.
[0005] The method comprises:
[0006] Acquire a target data set for side-scan sonar shipwreck detection, wherein the target data set includes a plurality of shipwreck images;
[0007] Construct an improved network model for YOLO; the improved network model is constructed based on the YOLOv8 network model; the improved network model of YOLO includes a backbone improvement network, a feature fusion improvement network, and three lightweight shared detection heads; the backbone improvement network includes several layers of first improved cross-stage partial aggregation modules; the feature fusion improvement network includes several layers of second improved cross-stage partial aggregation modules and several layers of upsampling improvement modules; the lightweight shared detection head includes a shared convolution module;
[0008] Train the improved network model using the target dataset to obtain a target improved network model;
[0009] Obtain a real-time dataset for side-scan sonar sunken ship detection, and perform object detection on the real-time dataset using the target network model.
[0010] Preferably, the shared convolution module includes a 1×1 convolutional layer and a 3×3 convolutional layer; the lightweight shared detection head further includes two 1×1 convolutional layers, a bounding box loss function layer, and a classification loss function layer; the input end of the 3×3 convolutional layer is connected to a 1×1 convolutional layer, and the output end of the 3×3 convolutional layer is connected to two 1×1 convolutional layers; the two 1×1 convolutional layers connected to the output end of the 3×3 convolutional layer are respectively connected to the bounding box loss function layer and the classification loss function layer.
[0011] Preferably, the backbone improvement network further includes several layers of conventional convolution modules and a pooling module;
[0012] There is one layer of the conventional convolution module between the upper layer of the first improved cross-stage partial aggregation module and the lower layer of the first improved cross-stage partial aggregation module; there are two layers of the conventional convolution module above the top layer of the first improved cross-stage partial aggregation module; there is one layer of the pooling module below the bottom layer of the first improved cross-stage partial aggregation module.
[0013] Preferably, the first improved cross-stage partial aggregation module includes two layers of the conventional convolution module, a cutting module, a splicing module, and several layers of lightweight gated convolution modules;
[0014] The two layers of the conventional convolution module in the same first improved cross-stage partial aggregation module are respectively located at the top layer and the bottom layer; the cutting module is located below the top layer of the conventional convolution module; the splicing module is located above the bottom layer of the conventional convolution module; several layers of the lightweight gated convolution modules are located between the cutting module and the splicing layer;
[0015] The splicing module is configured to splice the feature maps output by the topmost conventional convolution module, the cutting module, and each layer of lightweight gated convolution modules in the same first improved cross-stage partial aggregation module.
[0016] Preferably, the lightweight gated convolution module includes a first normalization unit and a second normalization unit; the first normalization unit is located above the second normalization unit;
[0017] The first normalization unit includes a first normalization module, a separable convolution module, and a first residual connection module connected in sequence; the second normalization unit includes a second normalization module, a convolutional gating module, and a second residual connection module connected in sequence;
[0018] The first residual connection module is configured to perform a residual connection process on the feature map output by the separable convolution module and the feature map input to the first normalization module;
[0019] The second residual connection module is configured to perform a residual connection process on the feature maps output by the first residual connection module and the convolutional gating module.
[0020] Preferably, the convolutional gating module includes a first fully connected module, a second fully connected module, a third fully connected module, a depth convolution module, a GELU activation function module, and a product module;
[0021] The first fully connected module and the second fully connected module are arranged in parallel; the depth convolution module and the GELU activation function module are arranged in sequence below the first fully connected module; the product module is connected to the GELU activation function module and the second fully connected module respectively; the third fully connected module is arranged below the product module;
[0022] The product module is configured to perform a product process on the feature maps output by the GELU activation function module and the second fully connected module;
[0023] The third fully connected module is configured to perform a feature transformation process and a feature integration process on the feature map output by the product module.
[0024] Preferably, the feature fusion improvement network is constructed based on a weighted feature fusion mechanism and a MAF-YOLO structure. The feature fusion improvement network includes several layers of feature fusion units; each layer of the feature fusion unit includes several layers of conventional convolution modules and several layers of second improved cross-stage partial aggregation modules; two adjacent feature fusion units are connected by the upsampling improvement module; the upsampling improvement module includes an upsampling module, a depth convolution module, a batch normalization module, a SiLU activation function module, and a pointwise convolution module connected in sequence.
[0025] The feature fusion unit is configured to:
[0026] Perform feature fusion processing on the feature map input to this layer and the first fusion feature map output by the next layer to obtain a second fusion feature map;
[0027] Output the second fusion feature map to the upper layer of the feature fusion unit after being processed by the upsampling improvement module connection and the second improved cross-stage partial aggregation module.
[0028] Preferably, the second improved cross-stage partial aggregation module includes two layers of conventional convolution modules, a cutting module, a splicing module, and several layers of multi-scale convolution improvement modules; the multi-scale convolution improvement module includes a pointwise convolution module, a batch normalization module, a SiLU activation function module, a multi-scale depth convolution improvement module, a pointwise convolution module, and a batch normalization module connected in sequence.
[0029] The two layers of conventional convolution modules in the same second improved cross-stage partial aggregation module are respectively located at the top layer and the bottom layer; the cutting module is located below the top layer of the conventional convolution module; the splicing module is located above the bottom layer of the conventional convolution module; several layers of the multi-scale convolution improvement modules are located between the cutting module and the splicing layer;
[0030] The splicing module is configured to splice the feature maps output by the top layer of the conventional convolution module, the cutting module, and each layer of the multi-scale convolution improvement module in the same second improved cross-stage partial aggregation module.
[0031] Preferably, the multi-scale depth convolution improvement module includes three layers of depth convolution units, an addition module, and a shuffle module; the three layers of depth convolution units are arranged in parallel, and each depth convolution unit includes a depth convolution module, a batch normalization module, and a SiLU activation function module; the addition module is respectively connected to each layer of the depth convolution unit and the shuffle module;
[0032] The addition module is configured to perform feature fusion on the feature maps output by the three layers of the depth convolution units through addition processing;
[0033] The shuffling module is configured to perform shuffling processing on the feature map output by the addition module.
[0034] Preferably, the step of obtaining a target data set for side-scan sonar shipwreck detection includes:
[0035] Acquire an initial dataset of side-scan sonar shipwreck detections;
[0036] Using LabelImg to label the initial dataset to obtain a first dataset, wherein the labeling includes marking the category, object name, and bounding box coordinates of each image in the initial dataset;
[0037] Performing sample expansion processing on the first data set to obtain a second data set, wherein the sample expansion processing includes a random rotation operation, a noise addition operation, a brightness change operation, an image flip operation, a grayscale operation, and a random erasure operation;
[0038] The second data set is divided according to a preset ratio to obtain the target data set, which includes a training set and a validation set after the division process.
[0039] As can be seen from the above content, the present application provides a lightweight side-scan sonar shipwreck image target detection method, the method comprising obtaining a target dataset for side-scan sonar shipwreck detection, the target dataset including several shipwreck images; constructing an improved network model of YOLO; the improved network model is constructed based on the YOLOv8 network model; the improved network model of YOLO includes a backbone improved network, a feature fusion improved network and a lightweight shared detection head; the backbone improved network includes several layers of first improved cross-stage partial aggregation modules; the feature fusion improved network includes several layers of second improved cross-stage partial aggregation modules and several layers of upsampling improved modules; the lightweight shared detection head includes a shared convolution module; the improved network model is trained using the target dataset to obtain a target improved network model; a real-time dataset for side-scan sonar shipwreck detection is obtained, and the target network model is used to perform target detection on the real-time dataset. The present application solves the problem that the existing side-scan sonar technology cannot achieve both high precision and fast detection at the same time through the above scheme. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0041] Figure 1 Flow chart of a target detection method for lightweight side-scan sonar shipwreck images in this application;
[0042] Figure 2 Schematic diagram of the backbone improvement network in a target detection method for lightweight side-scan sonar shipwreck images in this application;
[0043] Figure 3 For Figure 2 Schematic diagram of the first improved cross-stage partial aggregation module in
[0044] Figure 4 For Figure 3 Schematic diagram of the lightweight gated convolution module in
[0045] Figure 5 For Figure 4 Schematic diagram of the convolutional gating module in
[0046] Figure 6 Schematic diagram of the feature fusion improvement network in a target detection method for lightweight side-scan sonar shipwreck images in this application;
[0047] Figure 7 For Figure 6 Schematic diagram of the upsampling improvement module in
[0048] Figure 8 For Figure 7 Schematic diagram of the second improved cross-stage partial aggregation module in
[0049] Figure 9 For Figure 8 Schematic diagram of the multi-scale convolutional improvement module in
[0050] Figure 10 For Figure 9 Schematic diagram of the multi-scale depth convolutional improvement module in
[0051] Figure 11 Schematic diagram of the lightweight shared detection head in a target detection method for lightweight side-scan sonar shipwreck images in this application. Detailed implementation manners
[0052] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present invention.
[0053] It should be noted that the brief descriptions of terms in this application are only for the purpose of facilitating the understanding of the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their ordinary and usual meanings.
[0054] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0055] With the rapid growth of global marine resource development and maritime transportation, underwater target detection technology has become a key pillar of the marine economy and security system. In scenarios such as seabed geological exploration, shipwreck salvage and rescue, and underwater cultural heritage protection, higher requirements are placed on the efficient analytical capabilities of acoustic imaging equipment. Side-scan sonar systems, with their unique operating principle, generate continuous acoustic images of seafloor topography in low-light, high-turbidity environments by emitting fan-shaped sound waves toward the seafloor and receiving backscattered signals. Their coverage and resolution make them the preferred technology for large-scale underwater surveys. However, side-scan sonar images have inherent technical limitations in presenting target outlines: geometric distortion of the target caused by differences in sound wave propagation paths, complex noise interference caused by reflections from the seafloor sediment, and grayscale mutation effects in acoustic shadow areas and highly reflective areas. These characteristics require manual interpretation to rely on expert experience and multi-dimensional feature correlation analysis.
[0056] Traditional automatic detection algorithms are typically based on mechanisms such as threshold segmentation, texture analysis, or template matching, using manually designed feature extractors to identify target areas. When dealing with acoustic artifacts caused by undulating seafloor topography and speckle noise caused by clusters of marine organisms, these methods often suffer from insufficient feature generalization, leading to a surge in false detection rates. Furthermore, limited by the algorithm's ability to integrate global semantic information from images, traditional methods struggle to distinguish shipwreck structures from interfering objects such as reefs and sediments in complex backgrounds. Detection stability is particularly degraded when sonar images contain motion blur or equipment jitter noise.
[0057] The introduction of deep learning technology has opened up a new path for sonar image analysis. A two-stage detection framework centered around convolutional neural networks, through the cascading mechanism of candidate region generation and fine classification, demonstrates advantages in learning the edge features of sunken ships and associating and modeling acoustic shadows with the target body. However, the huge computational graph structure of such models places extremely high demands on hardware computing power, and is prone to computational redundancy due to the sharp increase in the number of region proposals in multi-target scenarios. Although the single-stage detection architecture simplifies the process through end-to-end feature mapping, while maintaining a lightweight model structure, it is insufficiently sensitive to small targets (such as sunken ship wreckage fragments) in sonar images and is easily interfered by similar texture features such as underwater sand waves and artificial fish reefs. It is worth noting that the real-time operation requirements of mobile carriers such as autonomous underwater vehicles (AUVs) impose more stringent constraints on the inference speed and energy consumption efficiency of algorithms - this requires the detection model to efficiently fuse multi-scale features under limited computing resources and possess robustness against the offset of the gray distribution of sonar images.
[0058] The core contradiction faced by current research lies in that existing methods have not established an effective balance mechanism between detection accuracy and computational efficiency. Although two-stage models can improve the detection rate of small targets through refined feature processing, their complex network topologies are difficult to meet the response requirements of real-time operation systems; although single-stage algorithms have better inference speeds, there are still performance bottlenecks in dimensions such as weak target feature extraction and discrimination of multiple types of interfering objects. In addition, the physical imaging characteristics unique to side-scan sonar images, such as azimuth dependence and slant range distortion, are essentially different from the data distribution of optical images, and directly migrating general object detection models often results in insufficient adaptability of the feature space. How to construct a lightweight network architecture adapted to the acoustic imaging mechanism and simultaneously achieve the adaptive weighted fusion of multi-dimensional features has become the key research direction for enhancing the practical value of underwater target detection engineering.
[0059] Based on the above problems, the present application provides the following embodiments.
[0060] Figure 1 It is a flowchart of a method for detecting targets in lightweight side-scan sonar sunken ship images of the present application.
[0061] Figure 2 It is a schematic diagram of the backbone improved network in a method for detecting targets in lightweight side-scan sonar sunken ship images of the present application.
[0062] Figure 6 It is a schematic diagram of the feature fusion improved network in a method for detecting targets in lightweight side-scan sonar sunken ship images of the present application.
[0063] Figure 11 It is a schematic diagram of the lightweight shared detection head in a method for detecting targets in lightweight side-scan sonar sunken ship images of the present application.
[0064] See Figure 1 、 Figure 2 、 Figure 6 and Figure 11 It can be seen that this embodiment provides a method for target detection of lightweight side-scan sonar shipwreck images, and the method includes:
[0065] S100. Obtain a target dataset for side-scan sonar shipwreck detection. The target dataset includes several shipwreck images. Specifically, in this embodiment, shipwreck images are collected through public datasets and provided by projects, and a target dataset of side-scan sonar shipwrecks is made.
[0066] Among them, the steps of obtaining the target dataset for side-scan sonar shipwreck detection include:
[0067] Sort out the pictures of the public dataset and the images provided by the project; use the annotation software LabelImg to annotate the real positions of shipwrecks in the side-scan sonar images in the dataset, and generate corresponding.txt format annotation files; use image enhancement technology to expand the dataset samples: by performing operations such as randomly rotating, adding noise, changing brightness, flipping images, grayscaling, and randomly erasing on the sonar images, visually expand the number of dataset samples; divide the training set, validation set, and test set in the processed dataset according to the ratio of 8:1:1 to obtain the final target dataset of shipwreck images.
[0068] The method further includes:
[0069] S200. Construct an improved network model of YOLO; the improved network model is constructed based on the YOLOv8 network model; the improved network model of YOLO includes a backbone improvement network, a feature fusion improvement network, and three lightweight shared detection heads; the backbone improvement network includes several layers of the first improved cross-stage partial aggregation module; the feature fusion improvement network includes several layers of the second improved cross-stage partial aggregation module and several layers of upsampling improvement modules; the lightweight shared detection head includes a shared convolution module.
[0070] Specifically, in this embodiment, an improved network model of YOLO is constructed: based on the YOLOv8 network model, the cross-stage partial aggregation module is improved; the feature fusion network is improved, a weighted feature fusion mechanism is adopted, the MAF-YOLO structure is fused, the upsampling module is improved by using an efficient upsampling convolution module, and the cross-stage partial aggregation module is reconstructed by using a multi-scale convolution module, where the activation function is replaced by SiLU (the activation function of the YOLOv8 convolution module); the detection head of YOLOv8 is reconstructed. The original detection head of YOLOv8 has a total of three branches, and each branch has four 3×3 convolutions and two 1×1 convolutions. The 3×3 convolution is the direct reason for the large number of parameters in the detection head. Therefore, in this embodiment, it is selected to reconstruct the detection head, and the idea of shared convolution is used to solve the problem of the large number of parameters of 3×3. The first two 3×3 convolutions are shared, greatly reducing the number of parameters. In addition, the first 3×3 convolution is replaced by a 1×1 convolution to further reduce the number of parameters.
[0071] The method further includes:
[0072] S300, training the improved network model by using the target data set to obtain a target improved network model. Specifically, in this embodiment, the improved network model is used to train the target data set of side-scan sonar shipwreck images: adjusting hyperparameters, training the obtained target data set, and obtaining an optimal weight file, so as to realize the training of the improved network model.
[0073] Exemplarily, set the image size input to the network and assign it as 640×640; create an initial model YOLO.yaml according to the improvement content; set hyperparameters, the number of epochs for batch training is 300, the batch size is set to 16, and the initial learning rate lr is 0.01; use the YOLO.yaml model to train the data set, and update the weight file, and keep best.pt; when epoch = 300, save the model weight of the last round last.pt, and the model training ends.
[0074] The method further includes:
[0075] S400, obtaining a real-time data set for side-scan sonar shipwreck detection, and performing target detection on the real-time data set by using the target network model. Specifically, in this embodiment, the saved optimal weight file is used for the shipwreck detection task in the real scene, and compared with other advanced models to prove the superiority of the algorithm.
[0076] Exemplarily, randomly select side-scan sonar shipwreck images from the test set; load the best.pt weight file and identify the shipwreck images; obtain the class name, confidence score, and corresponding target box coordinate information of the detection target, and display them on the image, and the detection ends; compare the improved algorithm with other advanced models to prove the superiority of the algorithm.
[0077] Further, in some embodiments, the shared convolution module includes a 1×1 convolutional layer, and the lightweight shared detection head further includes two 1×1 convolutional layers, a 3×3 convolutional layer, a bounding box loss function layer, and a classification loss function layer; the input end of the 3×3 convolutional layer is connected to a 1×1 convolutional layer, and the output end of the 3×3 convolutional layer is connected to two 1×1 convolutional layers; the two 1×1 convolutional layers connected to the output end of the 3×3 convolutional layer are respectively connected to the bounding box loss function layer and the classification loss function layer.
[0078] Specifically, in this embodiment, the lightweight shared detection head is as Figure 11 shown. The input feature map first passes through a 1×1 shared convolutional layer for feature fusion, and then passes through a 3×3 shared convolutional layer to extract the spatial information of the feature map, capturing local features while maintaining computational efficiency. After output from the 3×3 convolutional layer, it is divided into two branches. One branch is directly connected to a 1×1 convolutional layer and finally outputs to the bounding box loss, indicating that this branch is used to predict the position of the bounding box. The other branch is directly connected to a 1×1 convolutional layer and then outputs to the classification loss, indicating that this branch is used to predict the category of the target.
[0079] Further, in some embodiments, the backbone improvement network further includes several conventional convolution modules and a pooling module;
[0080] There is one layer of the conventional convolution module between the upper first improved cross-stage partial aggregation module and the lower first improved cross-stage partial aggregation module; there are two layers of the conventional convolution module above the topmost first improved cross-stage partial aggregation module; there is one layer of the pooling module below the bottommost first improved cross-stage partial aggregation module.
[0081] Specifically, in this embodiment, the feature map sequentially passes through layers P1, P2, P3, P4, and P5. Among them, layer P1 includes the conventional convolution module of the 0th layer, and each of the subsequent layers P2, P3, P4, and P5 includes a conventional convolution module and a first improved cross-stage partial aggregation module. Then it passes through the pooling module, and thus the feature extraction is completed.
[0082] Figure 3 For Figure 2 the schematic diagram of the first improved cross-stage partial aggregation module in
[0083] See Figure 3 It can be known that further, in some embodiments, the first improved cross-stage partial aggregation module includes two layers of the conventional convolution module, a cutting module, a splicing module, and several layers of lightweight gated convolution modules;
[0084] Two layers of the conventional convolutional modules in the same first improved cross-stage partial aggregation module are respectively located at the top layer and the bottom layer; the cutting module is located below the conventional convolutional module at the top layer; the splicing module is located above the conventional convolutional module at the bottom layer; several layers of lightweight gated convolutional modules are located between the cutting module and the splicing layer;
[0085] The splicing module is configured to splice the feature maps output by the conventional convolutional module at the top layer, the cutting module, and each layer of the lightweight gated convolutional modules in the same first improved cross-stage partial aggregation module.
[0086] Specifically, in this embodiment, the cross-stage partial aggregation modules of the 2nd, 4th, 6th, and 8th layers of the backbone improved network are replaced by the first improved cross-stage partial aggregation modules. The first improved cross-stage partial aggregation module is as Figure 3 shown. It can be seen from the figure that the first improved cross-stage partial aggregation module first preliminarily processes the input feature map through a conventional convolutional module, and then divides the feature map into two parts: one part is directly transmitted, and the other part is subjected to deep feature extraction through multiple lightweight gated convolutional modules, which can effectively extract and fuse multi-scale features. The processed feature map is spliced with the directly transmitted feature map in the channel dimension, and finally, a conventional convolutional module is used to complete feature fusion and channel compression, and the final feature map is output. This design not only improves the feature expression ability of the network but also optimizes the calculation efficiency, making YOLOv8 perform better in object detection tasks.
[0087] Figure 4 For Figure 3 the schematic diagram of the lightweight gated convolutional module in.
[0088] See Figure 4 It can be seen that, further, in some embodiments, the lightweight gated convolutional module includes a first normalization unit and a second normalization unit; the first normalization unit is located above the second normalization unit;
[0089] The first normalization unit includes a first normalization module, a separable convolutional module, and a first residual connection module connected in sequence; the second normalization unit includes a second normalization module, a convolutional gating module, and a second residual connection module connected in sequence;
[0090] The first residual connection module is configured to perform residual connection processing on the feature map output by the separable convolutional module and the feature map input to the first normalization module;
[0091] The second residual connection module is configured to perform residual connection processing on the feature maps output by the first residual connection module and the convolutional gating module.
[0092] Specifically, in this embodiment, as Figure 4 shown, it is the structural diagram of the lightweight gating convolutional module. The feature map is input into this module for normalization processing to standardize the feature values, which helps to accelerate the training process and improve the stability of the model. Next, a separable convolutional module is passed through to reduce the computational amount while extracting important information in the feature map. Next, the output of the separable convolutional module is added to the input feature map in the channel dimension to achieve residual connection. Then, the second normalization processing is performed. The normalized feature map enters the convolutional gating module to further process the feature map. Finally, the output of the convolutional gating module is added to the feature map after the second normalization for the second time to achieve residual connection again.
[0093] Figure 5 For Figure 4 the schematic diagram of the convolutional gating module in
[0094] Referring to Figure 5 it can be seen that, further, in some embodiments, the convolutional gating module includes a first fully-connected module, a second fully-connected module, a third fully-connected module, a depth convolutional module, a GELU activation function module, and a product module;
[0095] The first fully-connected module and the second fully-connected module are arranged in parallel; the depth convolutional module and the GELU activation function module are sequentially arranged below the first fully-connected module; the product module is respectively connected to the GELU activation function module and the second fully-connected module; the third fully-connected module is arranged below the product module;
[0096] The product module is configured to perform product processing on the feature maps output by the GELU activation function module and the second fully-connected module;
[0097] The third fully-connected module is configured to perform feature transformation processing and feature integration processing on the feature map output by the product module.
[0098] Specifically, in this embodiment, after the feature map enters the convolutional gating module, it first undergoes feature transformation through two parallel fully connected modules. Next, the output of one of the fully connected modules passes through a depth convolutional module for convolutional operation to further extract spatial features, and then enters the activation function module. Here, the GELU activation function is selected to introduce non-linearity. The feature map passing through the GELU activation function module is multiplied by the output of the other fully connected module to achieve feature interaction and weighting. The result of the product module passes through the last fully connected module for final feature transformation and integration, and the output feature map is obtained.
[0099] Figure 7 For Figure 6 The schematic diagram of the upsampling improvement module above.
[0100] See Figure 7 It can be seen that, further, in some embodiments, the feature fusion improved network is constructed based on a weighted feature fusion mechanism and the MAF-YOLO structure. The feature fusion improved network includes several layers of feature fusion units; each layer of the feature fusion unit includes several layers of conventional convolutional modules and several layers of second improved cross-stage partial aggregation modules; adjacent two feature fusion units are connected by the upsampling improvement module; the upsampling improvement module includes a layer of upsampling module, a layer of depth convolutional module, a layer of batch normalization module, a layer of SiLU activation function module, and a layer of pointwise convolutional module connected in sequence;
[0101] The feature fusion unit is configured to:
[0102] Perform feature fusion processing on the feature map input in this layer and the first fusion feature map output in the next layer to obtain a second fusion feature map;
[0103] Output the second fusion feature map to the feature fusion unit in the upper layer after being processed by the upsampling improvement module connection and the second improved cross-stage partial aggregation module.
[0104] Specifically, in this embodiment, first, the BiFPN weighted feature fusion mechanism is fused with the MAF-YOLO structure to form a new feature fusion network.
[0105] Channel alignment: The conventional convolutional modules of layer 10, layer 11, and layer 12 perform convolutional operations on the P3, P4, and P5 feature maps respectively to match the channel numbers for subsequent fusion operations.
[0106] First feature fusion: The P4 feature map is downsampled by convolution (layer 13) and fused with the feature map after convolution with P5 (layer 12) (layer 14). After fusion, it passes through the second improved cross-stage partial aggregation module (layer 15) to enhance the features. Next, upsampling is performed (layer 16) to match the resolution of the P4 layer. The P3 feature map is downsampled by convolution (layer 17) and fused with the P4 feature map and the feature map after upsampling in layer 16 (layer 18). Next, it passes through the second improved cross-stage partial aggregation module (layer 19) to enhance the features. Next, upsampling is performed (layer 20) to match the resolution of the P3 layer. The P2 layer feature map is downsampled by convolution and fused with the feature map after upsampling in layer 20 (layer 22), and then passes through the second improved cross-stage partial aggregation module (layer 23) to enhance the features.
[0107] Second feature fusion: The feature map after layer 23 is fused with the feature map after upsampling in layer 20 (layer 24). The feature map then passes through the second second improved cross-stage partial aggregation module (layer 25) to further enhance the features. The feature map after passing through layer 23 is downsampled by convolution (layer 26) for output preparation. The feature map after passing through layer 25 is downsampled by convolution (layer 27) for output preparation. The feature maps output from layer 16, layer 19, layer 26, and layer 27 are fused (layer 28). The fused feature map in layer 28 passes through the second second improved cross-stage partial aggregation module (layer 29) to further enhance the features. The feature map after passing through layer 19 is downsampled by convolution (layer 30) for output preparation. The feature map after passing through layer 29 is downsampled by convolution (layer 31) for output preparation. The feature maps output from layer 15, layer 30, and layer 31 are fused (layer 32). The fused feature map in layer 32 passes through the second second improved cross-stage partial aggregation module (layer 33) to further enhance the features.
[0108] As Figure 7 shown is the improved upsampling module in the above improved feature fusion network. First, the feature map passes through the upsampling module to increase the spatial resolution for fusion with higher-resolution feature maps. Next, it passes through the depthwise convolution module. Depthwise separable convolution is an efficient convolution operation that helps extract richer features while maintaining computational efficiency. The feature map then passes through the batch normalization module to accelerate the training process and improve the model's stability. The output after batch normalization passes through the activation function. Here, the activation function is improved to the SiLU activation function. SiLU is a gated linear unit that combines linear and non-linear characteristics and helps the model learn more complex feature representations. The feature map passes through the pointwise convolution module to adjust the number of channels of the feature map, which helps further fusion and refinement of the features, and finally outputs the feature map.
[0109] The improved upsampling module combines operations such as upsampling, depthwise separable convolution, batch normalization, SiLU activation function, and pointwise convolution to effectively enhance the input feature map and improve the resolution. This design not only improves the efficiency of feature fusion but also enhances the model's ability to capture multi-scale features, thereby improving the performance of object detection.
[0110] Figure 8 For Figure 7 the schematic diagram of the second improved cross-stage partial aggregation module in
[0111] Figure 9 For Figure 8 the schematic diagram of the multi-scale convolution improvement module in
[0112] See Figure 8 and Figure 9 It can be known that, further, in some embodiments, the second improved cross-stage partial aggregation module includes two layers of conventional convolution modules, one layer of cutting module, one layer of splicing module, and several layers of multi-scale convolution improvement modules; the multi-scale convolution improvement module includes a pointwise convolution module, a batch normalization module, a SiLU activation function module, a multi-scale depth convolution improvement module, a pointwise convolution module, and a batch normalization module connected in sequence;
[0113] The two layers of the conventional convolution modules in the same second improved cross-stage partial aggregation module are respectively located at the top layer and the bottom layer; the cutting module is located below the top layer of the conventional convolution module; the splicing module is located above the bottom layer of the conventional convolution module; several layers of the multi-scale convolution improvement modules are located between the cutting module and the splicing layer;
[0114] The splicing module is configured to splice the feature maps output by the top layer of the conventional convolution module, the cutting module, and each layer of the multi-scale convolution improvement module in the same second improved cross-stage partial aggregation module.
[0115] Specifically, in this embodiment, the second improved cross-stage partial aggregation module consists of a backbone and multiple parallel shortcut branches. First, the input feature map is subjected to preliminary feature extraction and channel number adjustment through a conventional convolution module. Next, the output of the conventional convolution module is split into two parts by the cutting module. One part is directly connected to the final splicing module through a shortcut, and the other part enters multiple multi-scale convolution improvement modules for processing.
[0116] The output of each multi-scale convolutional improvement module is connected to the final concatenation module through a shortcut connection for the concatenation operation of feature maps, merging feature maps of different scales. The concatenated feature maps are integrated through a conventional convolutional module to output feature maps. The feature maps pass through the first pointwise convolutional module to adjust the number of channels of the feature maps. After the conventional convolutional module, there are a batch normalization module and an activation function module. Here, the SiLU activation function is also selected as the activation function. The feature maps enter the multi-scale depth convolutional improvement module for further feature extraction and enhancement. After passing through the second pointwise convolutional module, the number of channels of the feature maps is further adjusted. After passing through the second batch normalization module, it waits for output. The output of the first pointwise convolutional module is directly combined with the output of the second batch normalization module through a shortcut. This structure helps with information flow and gradient propagation while reducing information loss, and finally outputs feature maps.
[0117] Figure 10 For Figure 9 the schematic diagram of the multi-scale depth convolutional improvement module in
[0118] See Figure 10 It can be known that, further, in some embodiments, the multi-scale depth convolutional improvement module includes three layers of depth convolutional units, one addition module, and one shuffle module; the three layers of depth convolutional units are arranged in parallel, and each depth convolutional unit includes one depth convolutional module, one batch normalization module, and one SiLU activation function module; the addition module is respectively connected to each layer of the depth convolutional unit and the shuffle module;
[0119] The addition module is configured to perform feature fusion on the feature maps output by the three layers of depth convolutional units through addition processing;
[0120] The shuffle module is configured to perform a shuffle process on the feature maps output by the addition module.
[0121] Specifically, in this embodiment, the input feature maps first pass through three depth convolutional modules. After each depth convolutional module, there is a batch normalization module and an activation function module. Here, the SiLU activation function is selected as the activation function. Next, the outputs of the three depth convolutional modules are fused through an addition operation. The fused feature maps are shuffled through a channel shuffle operation to enhance the feature expression ability and improve the generalization ability of the model.
[0122] The accuracy evaluation indicators for object detection performance use Precision (P), Recall (R), mean Average Precision (mAP), floating point operations per second (FLOPs), and the number of parameters (Parameters, Param) as evaluation indicators.
[0123] In classification problems, the prediction situations of positive and negative samples in the network are usually divided into True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN). TP: It represents the examples correctly identified as positive among positive samples; FP: It represents the examples wrongly identified as positive among negative samples; TN: It represents the examples correctly identified as negative among negative samples; FN: It represents the examples wrongly identified as negative among positive samples.
[0124] Precision represents the ratio of all correctly identified positive examples to all examples identified as positive, and the calculation formula is as shown in Formula 1.
[0125]
[0126] Recall represents the ratio of the positive examples correctly predicted among all positive samples to all positive examples in the sample, and the calculation formula is as shown in Formula 2.
[0127]
[0128] Taking Precision as the vertical axis and Recall as the horizontal axis, a (P-R) curve can be drawn. The P-R curve can clearly show the overall situation of the precision and recall of the sample set detected by the network. The area under the P-R curve is called Average Precision, and the calculation formula is as shown in Formula 3. The higher the value of AP, the better the detection performance of the network.
[0129]
[0130] The mean value of the AP values for each category in multiple category cases is called mAP, and the calculation formula is as shown in Formula 4. The goal of this study is a single category of shipwrecks, so AP is equal to mAP. mAP@0.5 means the IOU threshold is 0.5; if the overlapping area with the ground truth box exceeds 50%, the detection box is considered correct. mAP@0.5:0.95 represents the average value of mAP with an IOU interval from 0.5 to 0.95 and a step size of 0.05.
[0131]
[0132] After comprehensively analyzing the performance using indicators such as precision, recall, mean average precision, floating-point operations, and the number of parameters, the improved YOLO network model shows significant advantages compared with the original YOLOv8 network model. First, in terms of the model complexity we are most concerned about, in terms of the number of parameters, the improved YOLO network model reduces from 3 million parameters to 1.6 million parameters, achieving a reduction of approximately 47% in the number of parameters. In terms of floating-point operations, the improved YOLO network model reduces from 8.1 GFLOPs to 5.2 GFLOPs, achieving a reduction of approximately 36% in floating-point operations. Both are optimized to a more ideal level. In terms of the precision of the model, the improved YOLO network increases by 7.2%. In terms of recall, the improved YOLO network increases by 1.3%. In terms of mean average precision, mAP@0.5 increases by 2.6%, and mAP@0.5:0.95 increases by 0.9%. This indicates that the improved YOLO network model has also been significantly improved in detection accuracy and stability.
[0133] This embodiment has the following advantages:
[0134] (1) The improved YOLO network realizes model lightweighting, greatly reduces model complexity, saves a large amount of computing costs, and at the same time, the detection accuracy does not decrease but increases, improving the detection accuracy.
[0135] (2) Use lightweight gated convolution modules and convolutional gated modules to improve the cross-stage partial aggregation module, enhancing the model's feature extraction ability.
[0136] (3) Introduce the BiFPN weighted fusion method, combine it with the MAF-YOLO structure, and reconstruct the feature fusion network. Introduce an efficient upsampling convolution module as the upsampling module. Add multi-scale convolution to the cross-stage partial aggregation module to reconstruct the cross-stage partial aggregation module and improve its performance.
[0137] (4) Reconstruct the YOLO detection head, reduce the complexity of the detection head model, and further perform lightweight processing.
[0138] (5) The proposed network model improves the detection accuracy and speed while achieving lightweighting, enabling it to be applied to shipwreck detection in actual scenarios.
[0139] For the convenience of explanation, the above description has been made in combination with specific embodiments. However, the above discussion in some embodiments is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. According to the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are for better explaining the content of the present disclosure, so that those skilled in the art can better use the embodiments.
Claims
1. A target detection method for lightweight side-scan sonar shipwreck images, characterized in that The method includes: Obtaining a target dataset for side-scan sonar shipwreck detection, where the target dataset includes several shipwreck images; Constructing an improved network model of YOLO; the improved network model is constructed based on the YOLOv8 network model; the improved network model of YOLO includes a backbone improvement network, a feature fusion improvement network, and three lightweight shared detection heads; the backbone improvement network includes several layers of first improved cross-stage partial aggregation modules; the feature fusion improvement network includes several layers of second improved cross-stage partial aggregation modules and several layers of upsampling improvement modules; the lightweight shared detection head includes a shared convolution module; Training the improved network model using the target dataset to obtain a target improved network model; Obtaining a real-time dataset for side-scan sonar shipwreck detection, and performing object detection on the real-time dataset using the target network model.
2. The object detection method for lightweight side-scan sonar shipwreck images according to claim 1, characterized in that, The shared convolution module includes a 1×1 convolutional layer and a 3×3 convolutional layer; the lightweight shared detection head also includes two 1×1 convolutional layers, a bounding box loss function layer, and a classification loss function layer; the input end of the 3×3 convolutional layer is connected to a 1×1 convolutional layer, and the output end of the 3×3 convolutional layer is connected to two 1×1 convolutional layers; the two 1×1 convolutional layers connected to the output end of the 3×3 convolutional layer are respectively connected to the bounding box loss function layer and the classification loss function layer.
3. A method for target detection of lightweight side-scan sonar shipwreck images according to claim 1, characterized in that, The backbone improvement network further includes several layers of conventional convolution modules and a pooling module; There is one layer of the conventional convolution module between the upper first improved cross-stage partial aggregation module and the lower first improved cross-stage partial aggregation module; There are two layers of the conventional convolution module above the uppermost first improved cross-stage partial aggregation module; there is one layer of the pooling module below the lowermost first improved cross-stage partial aggregation module.
4. The object detection method for lightweight side-scan sonar shipwreck images according to claim 3, characterized in that, The first improved cross-stage partial aggregation module includes two layers of the conventional convolution module, a cutting module, a splicing module, and several layers of lightweight gated convolution modules; The two layers of the conventional convolution module in the same first improved cross-stage partial aggregation module are respectively located at the uppermost layer and the lowermost layer; the cutting module is located below the uppermost layer of the conventional convolution module; the splicing module is located above the lowermost layer of the conventional convolution module; several layers of the lightweight gated convolution modules are located between the cutting module and the splicing layer; The splicing module is configured to splice the feature maps output by the uppermost layer of the conventional convolution module, the cutting module, and each layer of the lightweight gated convolution module in the same first improved cross-stage partial aggregation module.
5. The object detection method for lightweight side-scan sonar shipwreck images according to claim 4, wherein, The lightweight gated convolution module includes a first normalization unit and a second normalization unit; the first normalization unit is located above the second normalization unit; The first normalization unit includes a first normalization module of one layer, a separable convolution module of one layer, and a first residual connection module connected in sequence; the second normalization unit includes a second normalization module of one layer, a convolutional gating module of one layer, and a second residual connection module connected in sequence; The first residual connection module is configured to perform residual connection processing on the feature map output by the separable convolution module and the feature map input to the first normalization module; The second residual connection module is configured to perform residual connection processing on the feature maps output by the first residual connection module and the convolutional gating module.
6. The object detection method for lightweight side-scan sonar shipwreck images according to claim 5, wherein, The convolutional gating module includes a first fully connected module of one layer, a second fully connected module of one layer, a third fully connected module of one layer, a depth convolution module of one layer, a GELU activation function module of one layer, and a product module; The first fully connected module and the second fully connected module are arranged in parallel; the depth convolution module and the GELU activation function module are arranged in sequence below the first fully connected module; the product module is connected to the GELU activation function module and the second fully connected module respectively; the third fully connected module is arranged below the product module; The product module is configured to perform product processing on the feature maps output by the GELU activation function module and the second fully connected module; The third fully connected module is configured to perform feature transformation processing and feature integration processing on the feature map output by the product module.
7. A method for target detection of lightweight side-scan sonar shipwreck images according to claim 1, characterized in that, The feature fusion improvement network is constructed based on a weighted feature fusion mechanism and a MAF-YOLO structure. The feature fusion improvement network includes several layers of feature fusion units; each layer of the feature fusion unit includes several layers of conventional convolution modules and several layers of second improved cross-stage partial aggregation modules; adjacent two feature fusion units are connected by the upsampling improvement module; the upsampling improvement module includes an upsampling module of one layer, a depth convolution module of one layer, a batch normalization module of one layer, a SiLU activation function module of one layer, and a pointwise convolution module connected in sequence; The feature fusion unit is configured to: Perform feature fusion processing on the feature map input to this layer and the first fusion feature map output by the next layer to obtain a second fusion feature map; 8. A method for target detection of lightweight side-scan sonar shipwreck images according to claim 7, characterized in that, Output the second fusion feature map to the upper layer of the feature fusion unit after being processed by the upsampling improvement module connection and the second improved cross-stage partial aggregation module. The second improved cross-stage partial aggregation module includes two layers of conventional convolution modules, a cutting module of one layer, a splicing module of one layer, and several layers of multi-scale convolution improvement modules; the multi-scale convolution improvement module includes a pointwise convolution module of one layer, a batch normalization module of one layer, a SiLU activation function module of one layer, a multi-scale depth convolution improvement module of one layer, a pointwise convolution module of one layer, and a batch normalization module of one layer connected in sequence; Two of the conventional convolutional modules in the same second improved cross-stage partial aggregation module are located at the topmost layer and the bottommost layer respectively; the cutting module is located below the conventional convolutional module at the topmost layer; the splicing module is located above the conventional convolutional module at the bottommost layer; several multi-scale convolutional improvement modules are located between the cutting module and the splicing layer; The splicing module is configured to splice the feature maps output by the conventional convolutional module at the topmost layer, the cutting module, and each multi-scale convolutional improvement module in the same second improved cross-stage partial aggregation module.
9. A target detection method for lightweight side-scan sonar shipwreck images according to claim 8, characterized in that, The multi-scale depth convolutional improvement module includes three depth convolutional units, one addition module, and one shuffle module; the three depth convolutional units are arranged in parallel, and each depth convolutional unit includes one depth convolutional module, one batch normalization module, and one SiLU activation function module; the addition module is respectively connected to each depth convolutional unit and the shuffle module; The addition module is configured to perform feature fusion on the feature maps output by the three depth convolutional units through addition processing; The shuffle module is configured to perform shuffle processing on the feature maps output by the addition module.
10. The object detection method for lightweight side-scan sonar shipwreck images according to claim 1, wherein, The steps of obtaining the target dataset for side-scan sonar shipwreck detection include: Obtaining an initial dataset for side-scan sonar shipwreck detection; Using LabelImg to perform annotation processing on the initial dataset to obtain a first dataset, and the annotation processing includes marking the category, object name, and bounding box coordinates of each image in the initial dataset; Performing sample augmentation processing on the first dataset to obtain a second dataset, and the sample augmentation processing includes random rotation operation, adding noise operation, changing brightness operation, flipping image operation, grayscale operation, and random erasing operation; Performing division processing on the second dataset according to a preset ratio to obtain the target dataset, and the target dataset includes the divided training set and validation set.