A sonar target detection method and device based on improved YOLOv4

By improving the sonar target detection method of YOLOv4 and combining data augmentation and feature fusion networks, the problems of missed detection of small targets and real-time performance in side-scan sonar detection were solved, thereby improving detection accuracy and speed.

CN116152649BActive Publication Date: 2026-07-31YICHANG TESTING TECHNIQUE RESEARCH INSTITUTE
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
YICHANG TESTING TECHNIQUE RESEARCH INSTITUTE
Filing Date
2022-11-22
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing side-scan sonar target detection methods have shortcomings in terms of real-time detection and low false negative rate for small targets. In particular, traditional methods are difficult to effectively extract features of small targets from side-scan sonar, the RCNN series algorithms are slow, and YOLOv3 has a high false negative rate for small targets.

Method used

An improved sonar target detection method based on YOLOv4 is adopted. By constructing an underwater side-scan sonar image training set, preprocessing and data augmentation are performed. The CSPDarknet53 backbone feature extraction network is used, and the SPP and PaNet networks are improved for feature fusion. Furthermore, the detection accuracy is improved by adding a large feature scale layer and the NMS maximum suppression method.

Benefits of technology

It improves the detection capability of small targets by side-scan sonar, reduces the false detection rate by 8%, and reduces the false detection rate of large targets by 11.2%, achieving higher detection accuracy and real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116152649B_ABST
    Figure CN116152649B_ABST
Patent Text Reader

Abstract

This invention discloses a sonar target detection method and apparatus based on an improved YOLOv4. The method includes: constructing a training set and a test set of underwater side-scan sonar images; preprocessing the images in the training set; constructing an improved YOLOv4 sonar target detection network; training the improved YOLOv4 sonar target detection network using the training set and testing it based on the test set to obtain a trained improved YOLOv4 sonar target detection network; acquiring an underwater side-scan sonar image to be identified and inputting it into the trained improved YOLOv4 sonar target detection network to obtain the type and location information of the target bounding box in the underwater side-scan sonar image to be identified. The method of this invention has a stronger detection capability for small targets detected by side-scan sonar.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image target recognition, and more specifically to a sonar target detection method and apparatus based on an improved YOLOv4. Background Technology

[0002] In recent years, with the intensification of marine activities, underwater unmanned equipment has developed rapidly. Sonar target detection technology is a key technology for unmanned equipment. Side-scan sonar detection, as a conventional method of sonar target detection, has the advantages of wide detection range and high detection efficiency. Therefore, improving the autonomous detection effect of side-scan sonar targets is of great significance.

[0003] Side-scan sonar transmits sound waves and then receives the echoes to form sonar images. Sound waves propagating in water are easily affected by noise, reverberation, and multipath effects, resulting in side-scan sonar images exhibiting characteristics such as blurred contours, low resolution, and limited target feature information, posing a significant challenge to target detection in side-scan sonar. Current side-scan sonar target detection methods are mainly as follows:

[0004] 1. Traditional target detection process includes: image preprocessing, target segmentation, target contour extraction, and target localization.

[0005] 2. Target recognition based on RCNN series algorithms.

[0006] 3. Target detection based on YOLOv3.

[0007] The aforementioned algorithms all have some problems. Current side-scan sonar targets are diverse and varied; even for the same target, the sonar image seen from different directions varies in size. Traditional sonar target detection relies on manual feature extraction, which is not only ineffective at extracting features of small targets in side-scan sonar but also lacks robustness to diverse side-scan sonar images. While target detection based on RCNN series algorithms has good detection performance, its detection speed is slow and cannot meet the real-time requirements of online detection. YOLOv3-based side-scan sonar target detection has good real-time performance, but its missed detection rate for small sonar targets is high. To simultaneously address the issues of real-time performance and high missed detection rate in target detection, this invention designs an improved YOLOv4 sonar target detection method to reduce the loss of small targets by improving the feature fusion network. Summary of the Invention

[0008] In view of this, the present invention provides a sonar target detection method and apparatus based on an improved YOLOv4, which can simultaneously solve the problems of real-time sonar target detection and missed detection of small targets.

[0009] To solve the above-mentioned technical problems, the present invention is implemented as follows.

[0010] A sonar target detection method based on an improved YOLOv4, comprising the following steps:

[0011] Step S1: Construct the underwater side-scan sonar image training set and test set;

[0012] Step S2: Preprocess the images in the underwater side-scan sonar image training set;

[0013] Step S3: Construct an improved YOLOv4 sonar target detection network;

[0014] Step S4: Train the improved YOLOv4 sonar target detection network using the underwater side-scan sonar image training set, and test it based on the test set to obtain the trained improved YOLOv4 sonar target detection network;

[0015] Step S5: Obtain the underwater side-scan sonar image to be identified, input it into the trained improved YOLOv4 sonar target detection network, and obtain the type and location information of the target box of the underwater side-scan sonar image to be identified.

[0016] Preferably, step S1 includes: acquiring raw underwater side-scan sonar image data; parsing the raw underwater side-scan sonar image data to generate a waterfall diagram; cropping the waterfall diagram to obtain a cropped image of size (608, 608), wherein the cropped image includes the region to be identified, and the region to be identified includes the target to be identified; annotating the cropped image using Yolo_mark to generate a txt format annotation file, thereby constructing an underwater side-scan sonar image training set and a test set.

[0017] Preferably, step S2 includes: performing data augmentation on the images in the underwater side-scan sonar image training set, wherein the data augmentation methods include CutMix, mosaic data augmentation, class label smoothing, and self-adversarial training.

[0018] Preferably, the backbone feature extraction network adopts CSPDarknet53. After the image is input into the feature extraction network, it outputs feature maps at four scales, namely (152, 152, 128), (76, 76, 256), (38, 38, 512), and (19, 19, 1024).

[0019] Preferably, the feature fusion network is used to receive feature maps of four scales output by the backbone feature extraction network; the feature fusion network includes an improved SPP network and an improved PaNet network connected in sequence; the improved SPP network uses four different pooling kernels of sizes (1,1), (3,3), (5,5), and (7,7) to replace the pooling kernels of sizes (1,1), (5,5), (9,9), and (13,13) in the SPP network; the feature map of scale (19,19,1024) is convolved to output a feature map of scale (19,19,512); the improved SPP network performs max pooling operation on the feature map of scale (19,19,512) based on the four different pooling kernels, and concatenates the pooling results to obtain a concatenated pooled feature map of scale (19,19,2048);

[0020] The concatenated pooled feature map is convolved to generate a first convolutional feature map with dimensions (19, 19, 512). The first convolutional feature map is then convolved and upsampled to generate a first upsampled feature map with dimensions (38, 38, 256). The feature map with dimensions (38, 38, 512) output by the backbone feature extraction network is convolved to generate a second convolutional feature map with dimensions (38, 38, 256). The first upsampled feature map and the second convolutional feature map are convolved and convolved to generate a first concatenated feature map with dimensions (38, 38, 256).

[0021] The first concatenated feature map is convolved and upsampled to generate a second upsampled feature map with a scale of (76, 76, 128). The feature map with a scale of (76, 76, 256) output by the backbone feature extraction network is convolved to generate a third convolutional feature map with a scale of (76, 76, 128). The second upsampled feature map and the third convolutional feature map are concatenated and convolved to generate a second concatenated feature map with a scale of (76, 76, 128).

[0022] The second concatenated feature map is convolved and upsampled to generate a third upsampled feature map with a scale of (152, 152, 64). The feature map with a scale of (152, 152, 128) output by the backbone feature extraction network is convolved to generate a fourth convolutional feature map with a scale of (152, 152, 64). The third upsampled feature map and the fourth convolutional feature map are convolved and convolved to generate a third concatenated feature map with a scale of (152, 152, 64).

[0023] The third spliced ​​feature map is passed through the first layer output of the improved PaNet network and used as the input of the first layer of the prediction network.

[0024] The third concatenated feature map is downsampled, and then concatenated and convolved with the second concatenated feature map to generate a fourth concatenated feature map with a scale of (76, 76, 128). The output of the second layer of the improved PaNet network is used as the input of the second layer of the prediction network.

[0025] The fourth spliced ​​feature map is downsampled, and after downsampling, it is spliced ​​and convolved with the first spliced ​​feature map to generate a fifth spliced ​​feature map with a scale of (38, 38, 256). The output of the third layer of the improved PaNet network is used as the input of the third layer of the prediction network.

[0026] The fifth concatenated feature map is downsampled, and after downsampling, it is concatenated and convolved with the first convolutional feature map to generate a sixth concatenated feature map. The output of the fourth layer of the improved PaNet network is used as the input of the fourth layer of the prediction network.

[0027] The improved PaNet network adds a large feature scale layer with a size of (152, 152, 128) on the basis of the PaNet network. The large feature scale layer sets prior boxes with scales of (4, 6), (7, 11), and (12, 17) to perform feature fusion on the output of the backbone feature extraction network. The fused features are then input into the prediction network.

[0028] The prediction network predicts the result based on the input of the feature fusion network. Each scale layer of the prediction network corresponds to three prior boxes of different sizes. The prediction network uses the NMS maximum suppression method to ensure that only one optimal candidate box is retained from multiple candidate boxes of the same target as the target box.

[0029] The device provided by this invention includes: a sonar target detection device based on an improved YOLOv4, comprising:

[0030] Training set generation module: configured to build training and test sets of underwater side-scan sonar images;

[0031] Preprocessing module: configured to preprocess the images in the underwater side-scan sonar image training set;

[0032] Network building module: Configured to build an improved YOLOv4 sonar target detection network;

[0033] Training module: configured to train the improved YOLOv4 sonar target detection network using the underwater side-scan sonar image training set, and test it based on the test set to obtain the trained improved YOLOv4 sonar target detection network;

[0034] Recognition module: configured to acquire the underwater side-scan sonar image to be identified, input it into the trained improved YOLOv4 sonar target detection network, and obtain the type and location information of the target box of the underwater side-scan sonar image to be identified.

[0035] The present invention provides a computer-readable storage medium storing a plurality of instructions; the plurality of instructions are used by a processor to load and execute the method as described above.

[0036] The present invention provides an electronic device, characterized in that the electronic device comprises:

[0037] A processor is used to execute multiple instructions;

[0038] Memory, used to store multiple instructions;

[0039] The plurality of instructions are to be stored in the memory and loaded and executed by the processor as described above.

[0040] Beneficial effects:

[0041] (1) The present invention has a stronger detection capability for small targets by side-scan sonar and reduces the false negative rate by 8%.

[0042] (2) The present invention reduces the false detection rate of large targets in side-scan sonar by 11.2%.

[0043] (3) The present invention is easy to implement. Attached Figure Description

[0044] Figure 1 A schematic diagram of the sonar target detection method based on the improved YOLOv4 provided by the present invention;

[0045] Figure 2 A schematic diagram of the improved YOLOv4 network structure provided by this invention;

[0046] Figure 3 A schematic diagram of the sonar target detection device based on the improved YOLOv4 provided by the present invention. Detailed Implementation

[0047] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0048] like Figures 1-2 As shown, this invention proposes a sonar target detection method based on an improved YOLOv4, comprising the following steps:

[0049] Step S1: Construct the underwater side-scan sonar image training set and test set;

[0050] Step S2: Preprocess the images in the underwater side-scan sonar image training set;

[0051] Step S3: Construct an improved YOLOv4 sonar target detection network;

[0052] Step S4: Train the improved YOLOv4 sonar target detection network using the underwater side-scan sonar image training set, and test it based on the test set to obtain the trained improved YOLOv4 sonar target detection network;

[0053] Step S5: Obtain the underwater side-scan sonar image to be identified, input it into the trained improved YOLOv4 sonar target detection network, and obtain the type and location information of the target box of the underwater side-scan sonar image to be identified.

[0054] Step S1 includes: acquiring raw underwater side-scan sonar image data; parsing the raw underwater side-scan sonar image data to generate a waterfall plot; cropping the waterfall plot to obtain a cropped image of size (608, 608), wherein the cropped image includes the region to be identified, and the region to be identified includes the target to be identified; annotating the cropped image using YOLO_mark to generate a txt format annotation file, thereby constructing an underwater side-scan sonar image training set and a test set.

[0055] Step S2 includes: performing data augmentation on the images in the underwater side-scan sonar image training set. The data augmentation methods include CutMix, mosaic data augmentation, class label smoothing, and self-adversarial training.

[0056] The improved YOLOv4 sonar target detection network includes a backbone feature extraction network, a feature fusion network, and a prediction network, which are connected sequentially.

[0057] The backbone feature extraction network adopts CSPDarknet53. After the image is input into the feature extraction network, it outputs feature maps at four scales, namely (152, 152, 128), (76, 76, 256), (38, 38, 512), and (19, 19, 1024).

[0058] In this embodiment, a color image with an input size of (608, 608, 3) is transformed into an image with a size of (608, 608, 32) after passing through a CBM. The image with a size of (608, 32, 32) is then passed through a CSP residual block sequentially. The feature map size is halved and the number of channels is doubled for each CSP residual block. A total of four scale feature maps are output, namely (152, 152, 128), (76, 76, 256), (38, 38, 512), and (19, 19, 1024).

[0059] The feature fusion network is used to receive feature maps of four scales output by the backbone feature extraction network. The feature fusion network includes an improved SPP network and an improved PaNet network connected in sequence. The improved SPP network uses four different pooling kernels of sizes (1,1), (3,3), (5,5), and (7,7) to replace the pooling kernels of sizes (1,1), (5,5), (9,9), and (13,13) in the SPP network. The feature map of scale (19,19,1024) is convolved to output a feature map of scale (19,19,512). The improved SPP network performs max pooling operation on the feature map of scale (19,19,512) based on the four different pooling kernels and concatenates the pooling results to obtain a concatenated pooled feature map of scale (19,19,2048).

[0060] The concatenated pooled feature map is convolved to generate a first convolutional feature map with dimensions (19, 19, 512). The first convolutional feature map is then convolved and upsampled to generate a first upsampled feature map with dimensions (38, 38, 256). The feature map with dimensions (38, 38, 512) output by the backbone feature extraction network is convolved to generate a second convolutional feature map with dimensions (38, 38, 256). The first upsampled feature map and the second convolutional feature map are convolved and convolved to generate a first concatenated feature map with dimensions (38, 38, 256).

[0061] The first concatenated feature map is convolved and upsampled to generate a second upsampled feature map with a scale of (76, 76, 128). The feature map with a scale of (76, 76, 256) output by the backbone feature extraction network is convolved to generate a third convolutional feature map with a scale of (76, 76, 128). The second upsampled feature map and the third convolutional feature map are concatenated and convolved to generate a second concatenated feature map with a scale of (76, 76, 128).

[0062] The second concatenated feature map is convolved and upsampled to generate a third upsampled feature map with a scale of (152, 152, 64). The feature map with a scale of (152, 152, 128) output by the backbone feature extraction network is convolved to generate a fourth convolutional feature map with a scale of (152, 152, 64). The third upsampled feature map and the fourth convolutional feature map are convolved and convolved to generate a third concatenated feature map with a scale of (152, 152, 64).

[0063] The third spliced ​​feature map is passed through the first layer output of the improved PaNet network and used as the input of the first layer of the prediction network.

[0064] The third concatenated feature map is downsampled, and then concatenated and convolved with the second concatenated feature map to generate a fourth concatenated feature map with a scale of (76, 76, 128). The output of the second layer of the improved PaNet network is used as the input of the second layer of the prediction network.

[0065] The fourth spliced ​​feature map is downsampled, and after downsampling, it is spliced ​​and convolved with the first spliced ​​feature map to generate a fifth spliced ​​feature map with a scale of (38, 38, 256). The output of the third layer of the improved PaNet network is used as the input of the third layer of the prediction network.

[0066] The fifth concatenated feature map is downsampled, and after downsampling, it is concatenated and convolved with the first convolutional feature map to generate a sixth concatenated feature map. The output of the fourth layer of the improved PaNet network is used as the input of the fourth layer of the prediction network.

[0067] The improved PaNet network adds a large feature scale layer with a size of (152, 152, 128) on the basis of the PaNet network. The large feature scale layer sets prior boxes with a size of (4, 6), (7, 11), and (12, 17) to perform feature fusion on the output of the backbone feature extraction network. The fused features are then input into the prediction network.

[0068] In this embodiment, based on the actual size of large targets in side-scan sonar, the improved SPP network uses (1,1), (3,3), (5,5), (7,7) instead of the original (1,1), (5,5), (9,9), (13,13) pooling layers to increase the appropriate network receptive field and reduce the false detection rate of medium and large targets.

[0069] In this embodiment, the improved PaNet network completes bottom-up and top-down feature fusion. The newly added large feature scale layer (152, 152, 128) reduces the loss of small target detail features during feature extraction, increases the influence of shallow information on prediction, and effectively reduces the false negative rate of small targets.

[0070] The prediction network predicts the result based on the input of the feature fusion network. Each scale layer of the prediction network corresponds to three prior boxes of different sizes. The prediction network uses the NMS maximum suppression method to ensure that only one optimal candidate box is retained from multiple candidate boxes of the same target as the target box.

[0071] In this embodiment, the prediction network convolves the input and outputs (152, 152, (5+classes)*3), (76, 76, (5+classes)*3), (38, 38, (5+classes)*3), (19, 19, (5+classes)*3), where 5 represents the four coordinates and one confidence score of the predicted bounding box. Since the same target includes a large number of predicted bounding boxes, the NMS maximum suppression method is used to ensure that only one predicted bounding box is retained for each target. The predicted bounding box is compared with the ground truth bounding box, and a loss function is constructed. The loss function is the sum of IOU loss, confidence loss, and class loss.

[0072] Step S4, the method for training the improved YOLOv4 sonar target detection network, includes:

[0073] Step S41: Set the initial network parameters and initialize the network weight coefficients of the improved YOLOv4 sonar target detection network;

[0074] Step S42: Input the images in the underwater side-scan sonar image training set and their corresponding annotation files into the improved YOLOv4 sonar target detection network for training until the loss function curve converges, and obtain the optimal weights corresponding to each parameter of the improved YOLOv4 sonar target detection network.

[0075] Step S5 further includes:

[0076] The location information of the target to be identified is obtained by performing nonmaximum suppression on the location information of the target bounding box in the underwater side-scan sonar image to be identified.

[0077] This invention provides an implementation method for underwater side-scan sonar image target detection based on an improved YOLOv4, the underwater side-scan sonar image target detection method comprising:

[0078] Step 1: Acquire raw side-scan sonar images using multi-beam side-scan sonar with 5 beams. Crop out the target area to obtain an image of size (608, 608), annotate it, and construct training and testing sets.

[0079] Step 2: Side scan sonar image preprocessing, using techniques such as CutMix, mosaic data augmentation, class label smoothing, and self-adversarial training to enrich the dataset;

[0080] Step 3: Construct an improved YOLOv4 sonar target detection network. The targets include underwater iron balls, bottom-sinking iron balls, and false targets. The number of target detection task c is 3, namely underwater iron balls, bottom-sinking iron balls, and false targets. False targets are used to reduce the false detection rate.

[0081] Step 4: Start training the improved YOLOv4 sonar target detection network by using the training images and corresponding annotation files as inputs. After the loss function converges, obtain the best network weight model best.weights.

[0082] Step 5: Using the model best.weights as input to the improved YOLOv4 sonar target detection network, test it on images in the test set, employ the maximum suppression method, and output the type and location information of the sonar target prediction box.

[0083] This invention also provides a sonar target detection device based on an improved YOLOv4, such as... Figure 3 As shown, the device includes:

[0084] The device includes:

[0085] Training set generation module: configured to build training and test sets of underwater side-scan sonar images;

[0086] Preprocessing module: configured to preprocess the images in the underwater side-scan sonar image training set;

[0087] Network building module: Configured to build an improved YOLOv4 sonar target detection network;

[0088] Training module: configured to train the improved YOLOv4 sonar target detection network using the underwater side-scan sonar image training set, and test it based on the test set to obtain the trained improved YOLOv4 sonar target detection network;

[0089] Recognition module: configured to acquire the underwater side-scan sonar image to be identified, input it into the trained improved YOLOv4 sonar target detection network, and obtain the type and location information of the target box of the underwater side-scan sonar image to be identified.

[0090] The specific embodiments described above only illustrate the design principles of the present invention. The shapes and names of the components in this description may differ and are not limited. Therefore, those skilled in the art can modify or make equivalent substitutions to the technical solutions described in the foregoing embodiments; and these modifications and substitutions do not depart from the inventive spirit and technical solutions of the present invention, and should all fall within the protection scope of the present invention.

Claims

1. A sonar target detection method based on improved YOLOv4, characterized in that, The method includes the following steps: Step S1: Construct the underwater side-scan sonar image training set and test set; Step S2: Preprocess the images in the underwater side-scan sonar image training set; Step S3: Construct an improved YOLOv4 sonar target detection network; Step S4: Train the improved YOLOv4 sonar target detection network using the underwater side-scan sonar image training set, and test it based on the test set to obtain the trained improved YOLOv4 sonar target detection network; Step S5: Obtain the underwater side-scan sonar image to be identified, input it into the trained improved YOLOv4 sonar target detection network, and obtain the type and location information of the target box of the underwater side-scan sonar image to be identified; The improved YOLOv4 sonar target detection network includes a backbone feature extraction network, a feature fusion network, and a prediction network, which are connected sequentially. The backbone feature extraction network adopts CSPDarknet53. After the image is input into the feature extraction network, it outputs feature maps at four scales, namely (152, 152, 128), (76, 76, 256), (38, 38, 512), and (19, 19, 1024). The feature fusion network is used to receive feature maps of four scales output by the backbone feature extraction network. The feature fusion network includes an improved SPP network and an improved PaNet network connected in sequence. The improved SPP network uses four different pooling kernels of sizes (1,1), (3,3), (5,5), and (7,7) to replace the pooling kernels of sizes (1,1), (5,5), (9,9), and (13,13) in the SPP network. The feature map of scale (19,19,1024) is convolved to output a feature map of scale (19,19,512). The improved SPP network performs max pooling operation on the feature map of scale (19,19,512) based on the four different pooling kernels and concatenates the pooling results to obtain a concatenated pooled feature map of scale (19,19,2048). The concatenated pooled feature map is convolved to generate a first convolutional feature map with dimensions (19, 19, 512). The first convolutional feature map is then convolved and upsampled to generate a first upsampled feature map with dimensions (38, 38, 256). The feature map with dimensions (38, 38, 512) output by the backbone feature extraction network is convolved to generate a second convolutional feature map with dimensions (38, 38, 256). The first upsampled feature map and the second convolutional feature map are convolved and convolved to generate a first concatenated feature map with dimensions (38, 38, 256). The first concatenated feature map is convolved and upsampled to generate a second upsampled feature map with a scale of (76, 76, 128). The feature map with a scale of (76, 76, 256) output by the backbone feature extraction network is convolved to generate a third convolutional feature map with a scale of (76, 76, 128). The second upsampled feature map and the third convolutional feature map are concatenated and convolved to generate a second concatenated feature map with a scale of (76, 76, 128). The second concatenated feature map is convolved and upsampled to generate a third upsampled feature map with a scale of (152, 152, 64). The feature map with a scale of (152, 152, 128) output by the backbone feature extraction network is convolved to generate a fourth convolutional feature map with a scale of (152, 152, 64). The third upsampled feature map and the fourth convolutional feature map are convolved and convolved to generate a third concatenated feature map with a scale of (152, 152, 64). The third spliced ​​feature map is passed through the first layer output of the improved PaNet network and used as the input of the first layer of the prediction network. The third concatenated feature map is downsampled, and then concatenated and convolved with the second concatenated feature map to generate a fourth concatenated feature map with a scale of (76, 76, 128). The output of the second layer of the improved PaNet network is used as the input of the second layer of the prediction network. The fourth spliced ​​feature map is downsampled, and after downsampling, it is spliced ​​and convolved with the first spliced ​​feature map to generate a fifth spliced ​​feature map with a scale of (38, 38, 256). The output of the third layer of the improved PaNet network is used as the input of the third layer of the prediction network. The fifth concatenated feature map is downsampled, and after downsampling, it is concatenated and convolved with the first convolutional feature map to generate a sixth concatenated feature map. The output of the fourth layer of the improved PaNet network is used as the input of the fourth layer of the prediction network. The improved PaNet network adds a large feature scale layer with a size of (152, 152, 128) on the basis of the PaNet network. The large feature scale layer sets prior boxes with scales of (4, 6), (7, 11), and (12, 17) to perform feature fusion on the output of the backbone feature extraction network. The fused features are then input into the prediction network. The prediction network predicts the result based on the input of the feature fusion network. Each scale layer of the prediction network corresponds to three prior boxes of different sizes. The prediction network uses the NMS maximum suppression method to ensure that only one optimal candidate box is retained from multiple candidate boxes of the same target as the target box.

2. The method of claim 1, wherein, Step S1 includes: acquiring raw underwater side-scan sonar image data; parsing the raw underwater side-scan sonar image data to generate a waterfall plot; cropping the waterfall plot to obtain a cropped image of size (608, 608), wherein the cropped image includes the region to be identified, and the region to be identified includes the target to be identified; annotating the cropped image using YOLO_mark to generate a txt format annotation file, thereby constructing an underwater side-scan sonar image training set and a test set.

3. The method as described in claim 1, characterized in that, Step S2 includes: performing data augmentation on the images in the underwater side-scan sonar image training set. The data augmentation methods include CutMix, mosaic data augmentation, class label smoothing, and self-adversarial training.

4. A sonar target detection device based on an improved YOLOv4, used to perform the method of any one of claims 1-3, characterized in that, The device includes: Training set generation module: configured to build training and test sets of underwater side-scan sonar images; Preprocessing module: configured to preprocess the images in the underwater side-scan sonar image training set; Network building module: Configured to build an improved YOLOv4 sonar target detection network; Training module: configured to train the improved YOLOv4 sonar target detection network using the underwater side-scan sonar image training set, and test it based on the test set to obtain the trained improved YOLOv4 sonar target detection network; Recognition module: configured to acquire the underwater side-scan sonar image to be identified, input it into the trained improved YOLOv4 sonar target detection network, and obtain the type and location information of the target box of the underwater side-scan sonar image to be identified.

5. A computer-readable storage medium storing a plurality of instructions; the plurality of instructions being loaded by a processor and executing the method as claimed in any one of claims 1-3.

6. An electronic device, characterized in that, The electronic device includes: A processor is used to execute multiple instructions; Memory, used to store multiple instructions; The plurality of instructions are to be stored in the memory and loaded by the processor and executed as described in any one of claims 1-3.