A method, system, electronic device, and storage medium for detecting shipwrecks.
By constructing a style transfer dataset and training an object detection network, the problems of high false alarm rate and low accuracy in shipwreck detection in sonar imaging under turbid waters were solved, achieving shipwreck detection results with high recall and low false alarm rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI UNIV
- Filing Date
- 2023-05-22
- Publication Date
- 2026-06-30
AI Technical Summary
Existing deep learning-based target detection technologies cannot be effectively applied to sonar imaging, especially in the detection of shipwrecks in turbid waters, where they suffer from high false alarm rates and low accuracy, making it difficult to meet engineering application standards.
A style transfer dataset is constructed, and a style transfer network model is used to transfer side-scan sonar images in good waters to shipwreck images in turbid waters. The model is then trained with an object detection network to generate a shipwreck detection model, which is used to detect shipwrecks in turbid waters.
Through data augmentation and model training, the recall rate of shipwreck detection in turbid waters was improved and the false alarm rate was reduced, enabling shipwreck detection using side-scan sonar imaging in turbid waters.
Smart Images

Figure CN116630607B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, and in particular to a method, system, electronic device, and storage medium for detecting shipwrecks. Background Technology
[0002] Since the beginning of the 21st century, human demand for marine resources has been gradually increasing, and the exploitation and utilization of marine resources has become an important development strategy for various countries. Therefore, a reliable method for detecting seabed targets is needed. Because visible light and infrared detection methods are greatly limited in seawater, while sonar systems utilize sound waves with strong penetrating power, wide propagation range, and high accuracy, sonar detection has become the primary means of ocean exploration.
[0003] Currently, deep learning-based target detection technology has been widely applied in the field of optics. However, sonar imaging differs greatly from optical imaging. Sonar is affected by factors such as seabed reverberation, resulting in high imaging noise; it is also affected by tow angle and sea conditions, making instance features unclear and prone to significant deformation; and due to the open seabed, it is difficult to observe, and the amount of data that can be collected is incomparable to that of optical images. Therefore, datasets and target detection network frameworks designed for ordinary optical images are not suitable for seabed exploration using sonar imaging, often resulting in a high false alarm rate and accuracy that fails to meet engineering application standards.
[0004] Furthermore, shipwreck detection is one of the most challenging aspects of this field with significant practical implications. Before the invention of steamships, due to frequent natural disasters, approximately 90% of ocean-going vessels perished at sea. In the past century alone, over 200,000 ocean-going vessels have been identified as having sunk. Therefore, the detection and salvage of shipwrecks are of great importance. On the one hand, the salvage of wrecked ships helps in subsequent accident analysis and prevention; on the other hand, shipwrecks may contain important artifacts, and the salvage process is a rediscovery of historical relics, contributing to the development of archaeology.
[0005] Sonar imaging detection of shipwrecks in turbid waters presents numerous challenges. Firstly, wooden vessels are inherently unstable, constantly eroded and covered by silt on the seabed. Furthermore, they may deform and break during the sinking process, resulting in irregular imaging characteristics that significantly increase the difficulty of detection. Secondly, the turbidity of the water can further degrade sonar imaging, making features less distinct and virtually eliminating visible acoustic shadows. Figure 3 and Figure 4 As shown, the background of the data to be detected is complex, the imaging effect of the shipwreck is poor, and it is difficult to distinguish the instance from the background. Existing technical solutions are completely unable to detect it. Summary of the Invention
[0006] The purpose of this invention is to provide a method, system, electronic device and storage medium for detecting shipwrecks, which enables the detection of shipwrecks by bottom-scan sonar imaging in turbid waters.
[0007] To achieve the above objectives, the present invention provides the following solution:
[0008] A method for detecting shipwrecks includes:
[0009] A style transfer dataset is constructed, comprising a content image dataset and a style image dataset. The content images in the content image dataset are side-scan sonar images of the shipwreck in well-marked waters, while the style images in the style image dataset are side-scan sonar images of the shipwreck in murky waters without any annotations. Based on the content image dataset and the style image dataset, a style transfer network model is used to generate simulated side-scan sonar images of the shipwreck in murky waters with annotations from the content images in the content image dataset.
[0010] The target detection network is trained based on the style transfer dataset and the side-scan sonar simulation images to obtain the target detection model;
[0011] Acquire side-scan sonar images of the water area to be detected;
[0012] The side-scan sonar image of the water area to be detected is input into the target detection model to obtain the shipwreck detection result.
[0013] Optionally, the style transfer network model specifically includes: a first generator, a second generator, a first discriminator, and a second discriminator; the first generator is used to transfer the style of the content image X in the content image dataset to a style simulation image X';
[0014] During the training of the style transfer network model, the second generator is used to transfer the style of the style image Y to a content simulation image Y', wherein the content image X represents a side-scan sonar image in good water, the style simulation image X' is a side-scan sonar image in turbid water, the style image Y represents a side-scan sonar image in turbid water, and the content simulation image Y' represents a side-scan sonar simulation image in good water; the first generator is also used to transfer the style of the style simulation image X' back to the content simulation image X'", the content simulation image X' is a side-scan sonar simulation image in good water containing a shipwreck; the second generator is also used to transfer the style of the content simulation image Y' back to the style simulation image Y'", the content simulation image Y' is a side-scan sonar simulation image in turbid water containing a shipwreck;
[0015] The first discriminator is used to output the probability that the first generator will transfer the content image to the style image, and optimize the first generator through backpropagation; the second discriminator is used to output the probability that the second generator will transfer the style image to the content image, and optimize the second generator through backpropagation.
[0016] Optionally, the style transfer network model further includes a random color shift module and a third discriminator; during the training process of the style transfer network model, the random color shift module is used to perform a random color shift operation on the style simulation image X' output by the first generator to generate a first random color shift image, the random color shift module is used to perform a random color shift operation on the style image Y in the style image dataset to generate a second random color shift image, and the third discriminator is used to distinguish between the first random color shift image and the second random color shift image.
[0017] Optionally, the total loss function during the optimization process of the style transfer network model is expressed as:
[0018]
[0019] Among them, L(G X G Y D X D Y D t (x,y) represents the total loss function, G X G represents the first generator. Y Let X represent the second generator, Y represent the content image, and D represent the style image. X D represents the first discriminator. Y D represents the second discriminator. t L represents the third discriminator. cyc (G X G Y ) represents the loss between the input and output images of the style transfer network model, L GAN (G X G Y D X D Y D t ,X,Y) represents the adversarial loss, and λ represents the weighting coefficient.
[0020] Optionally, the random color shift operation is represented as:
[0021] F rcs( I rgb )=(1-α)(β1×I r +β2×I g +β3×I b )+α×C;
[0022] Where C represents the grayscale image of the image to be subjected to random color shifting, and F rcs (I rgb ) represents the image after a random color shift operation, I r I represents the pixel value of the R channel of the image to be subjected to random color shifting. g I represents the pixel value of the G channel of the image to be subjected to random color shifting. b α represents the pixel value of the B channel of the image to be subjected to random color shifting, α represents the first weight parameter, β1 represents the second weight parameter, β2 represents the third weight parameter, and β3 represents the fourth weight parameter.
[0023] Optionally, the target detection network includes a backbone network, a feature fusion module, and a detection head; the backbone network is used to extract features from the input image at different scales, the feature fusion module is used to fuse features from the feature maps of different scales output by the backbone network, and the detection head is used to output the detection result, wherein the detection head is the detection head of the FCOS network.
[0024] Optionally, training the target detection network based on the style transfer dataset and the side-scan sonar simulation images to obtain the target detection model specifically includes:
[0025] The content images in the content image dataset and the side-scan sonar simulation images are combined to form a first training set. The target detection network is trained using the first training set to obtain a pre-trained model.
[0026] A set number of content images are extracted from the content image dataset. The set number of content images and the images in the style image dataset are combined to form a second training set. The detection head of the pre-trained model is trained using the second training set to obtain the target detection model.
[0027] This invention discloses a shipwreck detection system, comprising:
[0028] A style transfer dataset module is used to construct a style transfer dataset. The style transfer dataset includes a content image dataset and a style image dataset. The content images in the content image dataset are side-scan sonar images of the shipwreck in well-water conditions with annotations. The style images in the style image dataset are side-scan sonar images of the shipwreck in turbid water conditions without annotations. The turbidity of the turbid water is greater than that of the well-water conditions.
[0029] The side-scan sonar simulation image generation module is used to generate side-scan sonar simulation images of the shipwreck in turbid waters using a style transfer network model based on the content image dataset and the style image dataset.
[0030] The target detection network training module is used to train the target detection network based on the style transfer dataset and the side-scan sonar simulation image to obtain the target detection model;
[0031] The side-scan sonar image acquisition module under the water area to be detected is used to acquire side-scan sonar images under the water area to be detected.
[0032] The target detection model includes a shipwreck detection module, which inputs the side-scan sonar image of the water area to be detected into the target detection model to obtain the shipwreck detection result.
[0033] The present invention discloses an electronic device, including a memory and a processor. The memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the shipwreck detection method.
[0034] The present invention discloses a computer-readable storage medium, characterized in that it stores a computer program, which, when executed by a processor, implements the shipwreck detection method.
[0035] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0036] This invention utilizes a style transfer network model to transfer shipwreck images from side-scan sonar imaging in good waters to shipwreck images in turbid waters, thereby augmenting the training data and solving the problem of a small number of targets in side-scan sonar images in turbid waters. Based on the augmented dataset, a trained target detection model is obtained, and the target detection model is used to detect shipwrecks in side-scan sonar imaging in turbid waters. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a schematic diagram of a shipwreck detection method according to the present invention;
[0039] Figure 2 This is a logic flowchart of a shipwreck detection method according to the present invention;
[0040] Figure 3 This is sample image 1 in the style image dataset of this invention;
[0041] Figure 4 This is sample image 2 in the style image dataset of this invention;
[0042] Figure 5 This is a schematic diagram of a shipwreck example in an image to be detected in turbid waters according to the present invention;
[0043] Figure 6 This is a schematic diagram illustrating the style transfer effect of the style transfer network model of the present invention;
[0044] Figure 7 This is a schematic diagram of the style transfer network model of the present invention;
[0045] Figure 8 This is a schematic diagram of the target detection network of the present invention;
[0046] Figure 9 This is a schematic diagram of the detection head of the present invention;
[0047] Figure 10 The loss curve is the improved loss function of the target detection model of this invention.
[0048] Figure 11 This is a schematic diagram of a shipwreck detection system according to the present invention. Detailed Implementation
[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0050] The purpose of this invention is to provide a method, system, electronic device and storage medium for detecting shipwrecks, enabling the detection of shipwrecks by bottom-scan sonar imaging in turbid waters.
[0051] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0052] Example 1
[0053] like Figure 1 and Figure 2 As shown, the present invention provides a method for detecting shipwrecks, which includes the following steps:
[0054] Step 101: Construct a style transfer dataset; the style transfer dataset includes a content image dataset and a style image dataset. The content images in the content image dataset are side-scan sonar images of well-dwelling water with the shipwreck annotated. The style images in the style image dataset are side-scan sonar images of turbid water without the shipwreck annotated. The style images in the style image dataset include images containing the shipwreck and images not containing the shipwreck.
[0055] Style images in the style image dataset, such as Figure 3 and Figure 4 As shown.
[0056] The turbidity of the turbid water is greater than that of the good water.
[0057] More specifically, good water is water with turbidity within a first set range, and turbid water is water with turbidity within a second set range, where the upper limit of the first set range is less than the lower limit of the second set range.
[0058] As a specific implementation method, side-scan sonar data of shipwreck instances in good waters were acquired, including 1,442 images containing shipwrecks and 1,455 shipwreck instances. The shipwrecks were labeled to determine their location and category information. Side-scan sonar imaging data (style images) of turbid waters were acquired, including 10 images containing shipwreck instances and 137 background images where no shipwreck instances were found.
[0059] Remove the water column region from the turbid water image, randomly crop the turbid water image after removing the water column region, resize it to 640×640, and save the image as a style image dataset in style transfer.
[0060] Based on the maximum side length, the rectangular bounding boxes of shipwreck instances in well-drained waters are cropped according to the labels, and the size is resized to 640×640. The images are then saved as the content image dataset in style transfer.
[0061] This invention constructs the proposed style transfer network model sonar_cycle_gan, which adds a random color shift module to the cycle_gan model to generate side-scan sonar simulation images of shipwrecks in turbid waters. The style transfer network model is as follows: Figure 7 As shown. The style transfer network model outputs side-scan sonar simulation images as follows. Figure 6 As shown, the input image for the style transfer network model includes the content image ( Figure 6 (Input image in the middle and top) and style image ( Figure 6 The input image is located in the lower middle section, and the output is a side-scan sonar simulation image.
[0062] Figure 7 Discriminator 1 / 2 / 3 indicates that there are three discriminators: a first discriminator, a second discriminator, and a third discriminator. Generator 1 is the first generator, generator 2 is the second generator, LGAN represents the adversarial loss, and L... cyc This represents the loss between the input and output images of the style transfer network model.
[0063] Step 102: Based on the content image dataset and the style image dataset, a style transfer network model is used to generate side-scan sonar simulation images of the shipwreck in turbid water with annotations from the content images in the content image dataset.
[0064] Step 103: Train the target detection network based on the style transfer dataset and the side-scan sonar simulation image to obtain the target detection model.
[0065] The style transfer dataset and the side-scan sonar simulation images form a training set to train the target detection network and obtain the target detection model.
[0066] Step 104: Acquire side-scan sonar images of the water area to be detected.
[0067] Step 105: Input the side-scan sonar image of the water area to be detected into the target detection model to obtain the shipwreck detection result.
[0068] The image to be detected (side-scan sonar image under the water area to be detected) is as follows Figure 5 As shown, Figure 5 The "ship" symbol indicates the results of the shipwreck inspection.
[0069] The style transfer network model specifically includes: a first generator, a second generator, a first discriminator, and a second discriminator; the first generator is used to transfer the style of the content image X in the content image dataset to a style simulation image X';
[0070] During the training of the style transfer network model, the second generator is used to transfer the style of style image Y to a content simulation image Y', where content image X represents a side-scan sonar image in good water, style simulation image X' is a side-scan sonar image in turbid water, style image Y represents a side-scan sonar image in turbid water, and content simulation image Y' represents a side-scan sonar simulation image in good water. The first generator is also used to transfer the style of style simulation image X' back to content simulation image X'", where content simulation image X' is a side-scan sonar simulation image in good water containing a shipwreck; the second generator is also used to transfer the style of content simulation image Y' back to style simulation image Y'", where content simulation image Y' is a side-scan sonar simulation image in turbid water containing a shipwreck. This process is used to reduce the destruction of image content (shipwreck instance) by the generator model during the generation process.
[0071] The first discriminator is used to output the probability that the first generator will transfer the content image to the style image, and optimize the first generator through backpropagation; the second discriminator is used to output the probability that the second generator will transfer the style image to the content image, and optimize the second generator through backpropagation.
[0072] The style transfer network model also includes a random color shift module and a third discriminator. A sonar image is a seabed topographical image formed by the reflection of sound waves emitted by the sonar on the seabed, based on the intensity of the reflected sound waves. According to imaging characteristics, it is an image of a single-channel grayscale image. In actual imaging, pseudo-color processing is used to convert the grayscale image into a color image, simulating the color characteristics of three channels. Therefore, the random color shift module and the third discriminator are used to remove the influence of three-channel color on the sonar image.
[0073] The total loss function during the optimization of the style transfer network model is expressed as:
[0074]
[0075] Among them, L(G X G Y D X D Y D t (x,y) represents the total loss function, G X G represents the first generator. Y Let X represent the second generator, Y represent the content image, and D represent the style image. X D represents the first discriminator. Y D represents the second discriminator. t L represents the third discriminator. cyc (G X G Y) represents the loss between the input and output images of the style transfer network model, L GAN (G X G Y D X D Y D t ,X,Y) represents the adversarial loss, which optimizes the discriminator's discrimination ability and the generator's generation ability in an adversarial manner during the backpropagation stage, and λ represents the weight coefficient.
[0076] During the training of the style transfer network model, the random color shift module is used to perform a random color shift operation on the style simulation image X' output by the first generator to generate a first random color shift image, the random color shift module is used to perform a random color shift operation on the style image Y in the style image dataset to generate a second random color shift image, and the third discriminator is used to discriminate between the first random color shift image and the second random color shift image.
[0077]
[0078]
[0079] Among them, Ex~p data (x) represents the expected value of the source domain image x, Ey~pdata(y) represents the expected value of the source domain image y, tx represents the regression target of the source domain image x, ty represents the regression target of the source domain image y, the values of tx and ty are 0 or 1, and Dt represents the third discriminator. Source domain image.
[0080] Where F rcs (.) represents the random color shift (RCS) operation. The random color shift operation is used to extract high-frequency texture information from the original image, reduce the influence of color and brightness, and remove the noise introduced when converting a grayscale image to an RGB image during sonar imaging. Dt is the discriminator (third discriminator) after performing the RCS operation on the image X and Y.
[0081] The random color shift operation is represented as follows:
[0082] F rcs (I rgb )=(1-α)(β1×I r +β2×I g +β3×I b )+α×C;
[0083] Where C represents the grayscale image of the image to be subjected to random color shifting, and F rcs (I rgb ) represents the image after a random color shift operation, I rI represents the pixel value of the R channel of the image to be subjected to random color shifting. g I represents the pixel value of the G channel of the image to be subjected to random color shifting. b α represents the pixel value of the B channel of the image to be subjected to random color shifting, α represents the first weight parameter, β1 represents the second weight parameter, β2 represents the third weight parameter, and β3 represents the fourth weight parameter.
[0084] Data augmentation is performed using the style transfer operation of this invention to generate simulated images, expanding the style transfer dataset to 2330 images.
[0085] The target detection network includes a backbone network, a neck module, and a head module. The backbone network is used to extract features from the input image at different scales. The feature fusion module is used to fuse features from the feature maps of different scales output by the backbone network. The head module is used to output the detection results. The head module is the detection head of the FCOS network. Figure 8 (FCOSHead).
[0086] As a specific implementation, the object detection network is YOLOv5+FCOS, with the backbone network using YOLOv5. Since underwater shipwreck instances have inconspicuous features in images and are extremely rare, a backbone with strong feature extraction capabilities and a relatively simple training label assignment strategy are needed. Therefore, the YOLOv5 backbone is used to enhance feature extraction capabilities; the FCOS label assignment strategy and prediction head are used to simplify the training burden.
[0087] Object detection networks such as Figure 8 As shown, CSPDarknet and SPPBottleneck are the basic components of the YOLOv5 model.
[0088] FCOSHead Figure 9 As shown, Classification, Center-ness, and Regression are the basic prediction branches of the FCOS object detection head. Classification predicts classification, and the Regression branch is responsible for predicting the position of objects in the image. (l,r,t,b) correspond to the four sides of the bounding box predicted at a certain anchor point and the left, right, top, and bottom distances of that anchor point, respectively. Here, H represents the image height, W represents the image width, and C represents the number of channels.
[0089] Step 103 specifically includes:
[0090] Step 1031: Combine the content images in the content image dataset and the side-scan sonar simulation images into a first training set, and use the first training set to train the target detection network to obtain a pre-trained model.
[0091] During the training phase of the object detection network, backpropagation is used to optimize the detection performance.
[0092] The specific formula for the first loss function used when training the object detection network on the first training set is as follows:
[0093]
[0094] Among them, {p x,y} represents the confidence level and location coordinates of the shipwreck category predicted by the object detection network, {t x,y} represents the actual shipwreck category (since the detection category is a single category, it only refers to shipwrecks here) and location coordinates, N pos L represents the number of positive samples. cls L is the classification loss calculated for the predicted categories. reg The localization loss is calculated for the predicted bounding box location, with λ as a weight term used to balance the classification and localization losses in the loss term. x,y This indicates the actual shipwreck category information, t* x,y This indicates the actual coordinates of the sunken ship.
[0095] L cls and L reg The specific formula is as follows:
[0096] Lcls(p,t)=focal_loss(p t )=-(1-p t ) λ log(p t ).
[0097]
[0098] After the loss function of the object detection network is calculated, gradient propagation is performed using PyTorch's built-in gradient backpropagation algorithm to optimize the algorithm's performance.
[0099] This invention uses non-transfer images and style-transfer images as the first training set. The target detection algorithm can detect 6 out of 10 shipwreck instances in turbid waters, which greatly improves the detection recall rate.
[0100] Step 1032: Extract a set number of content images from the content image dataset, combine the set number of content images and the images in the style image dataset to form a second training set, and use the second training set to train the detection head of the pre-trained model to obtain the target detection model.
[0101] Step 1032 involves fine-tuning the target detection model based on unlabeled images of turbid water, thereby reducing the false alarm rate.
[0102] Due to the complex underwater environment and the chaotic sonar imaging, a large amount of irregular noise is easily misjudged by the detector, resulting in a large number of false alarms. Although the target detection algorithm using style transfer can achieve a better recall rate, the large number of false alarms still cannot meet the application requirements. To address the phenomenon that there are very few instances of shipwrecks on the seabed but a large amount of background, and that targets exist in the image with a very low probability, a method is proposed to fine-tune the algorithm using the proposed double-stage focal loss function.
[0103] Its specific implementation is as follows:
[0104] Based on the concept of fine-tuning object detection, during fine-tuning, 147 unlabeled images of murky water areas are used as the query set (test set), and an equal number of 147 images of shipwrecks in well-drained water areas are extracted as the support set (training set). The shipwreck images in the support set retain their labels, and these are combined to form the dataset used for fine-tuning (the second training set). The original focal loss function is replaced with the proposed improved loss function, double_stage_focal_loss, which addresses the loss on negative samples. Figure 10 As shown.
[0105] The loss function double_stage_focal_loss is calculated the same for positive samples as the first loss function, while the second loss function is used for negative samples. The specific implementation of the second loss function is as follows:
[0106]
[0107] Where λ is the exponential weight for calculating the loss of negative samples when the prediction confidence p < 0.3, and γ is the exponential weight for calculating the loss of negative samples when the prediction confidence p ≥ 0.3. This is used to reduce the impact of the algorithm on unlabeled instances and alleviate the decrease in recall. p is the confidence of the corresponding maximum class predicted for each anchor point in the network header.
[0108] In step 1032, the backbone network and feature fusion module of the network are frozen during fine-tuning of the second training set, and gradients are calculated and backpropagation is performed only for the head part.
[0109] Training was stopped after 12 epochs.
[0110] The fine-tuned target detection model largely retains the detection performance of positive samples while significantly reducing the false alarm rate.
[0111] Example 2
[0112] Figure 11 This is a schematic diagram of a shipwreck detection system according to the present invention, as shown below. Figure 11 As shown, a shipwreck detection system includes:
[0113] Style transfer dataset module 201 is used to construct a style transfer dataset; the style transfer dataset includes a content image dataset and a style image dataset, wherein the content images in the content image dataset are side-scan sonar images of the shipwreck in well-drained water with annotations, and the style images in the style image dataset are side-scan sonar images of the shipwreck in turbid water without annotations.
[0114] The turbidity of the turbid water is greater than that of the good water.
[0115] The side-scan sonar simulation image generation module 202 is used to generate side-scan sonar simulation images of the shipwreck in turbid waters using a style transfer network model based on the content image dataset and the style image dataset.
[0116] The target detection network training module 203 is used to train the target detection network based on the style transfer dataset and the side-scan sonar simulation image to obtain the target detection model.
[0117] The side-scan sonar image acquisition module 204 under the water area to be detected is used to acquire side-scan sonar images under the water area to be detected.
[0118] The target detection model uses a shipwreck detection module 205 to input the side-scan sonar image of the water area to be detected into the target detection model to obtain the shipwreck detection result.
[0119] Example 3
[0120] This invention provides an electronic device including a memory and a processor. The memory stores a computer program, and the processor runs the computer program to enable the electronic device to perform a shipwreck detection method according to Embodiment 1.
[0121] Alternatively, the aforementioned electronic device may be a server.
[0122] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements a shipwreck detection method of Embodiment 1.
[0123] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.
[0124] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for detecting shipwrecks, characterized in that, include: A style transfer dataset is constructed, comprising a content image dataset and a style image dataset. The content images in the content image dataset are side-scan sonar images of the shipwreck in well-marked waters, while the style images in the style image dataset are side-scan sonar images of the shipwreck in murky waters without any annotations. Based on the content image dataset and the style image dataset, a style transfer network model is used to generate simulated side-scan sonar images of the shipwreck in murky waters with annotations from the content images in the content image dataset. The target detection network is trained based on the style transfer dataset and the side-scan sonar simulation images to obtain the target detection model; Acquire side-scan sonar images of the water area to be detected; The side-scan sonar image of the water area to be detected is input into the target detection model to obtain the shipwreck detection result.
2. The shipwreck detection method according to claim 1, characterized in that, The style transfer network model specifically includes: a first generator, a second generator, a first discriminator, and a second discriminator; the first generator is used to transfer the style of the content image X in the content image dataset to a style simulation image X'; During the training of the style transfer network model, the second generator is used to transfer the style of the style image Y to a content simulation image Y', wherein the content image X represents a side-scan sonar image in good water, the style simulation image X' is a side-scan sonar image in turbid water, the style image Y represents a side-scan sonar image in turbid water, and the content simulation image Y' represents a side-scan sonar simulation image in good water; the first generator is also used to transfer the style of the style simulation image X' back to the content simulation image X'', the content simulation image X'' being a side-scan sonar simulation image in good water containing a shipwreck; the second generator is also used to transfer the style of the content simulation image Y' back to the style simulation image Y'', the style simulation image Y'' being a side-scan sonar simulation image in turbid water containing a shipwreck. The first discriminator is used to output the probability that the first generator will transfer the content image to the style image, and optimize the first generator through backpropagation; the second discriminator is used to output the probability that the second generator will transfer the style image to the content image, and optimize the second generator through backpropagation.
3. The shipwreck detection method according to claim 2, characterized in that, The style transfer network model further includes a random color shift module and a third discriminator. During the training process of the style transfer network model, the random color shift module is used to perform a random color shift operation on the style simulation image X' output by the first generator to generate a first random color shift image. The random color shift module is used to perform a random color shift operation on the style image Y in the style image dataset to generate a second random color shift image. The third discriminator is used to distinguish between the first random color shift image and the second random color shift image.
4. The shipwreck detection method according to claim 3, characterized in that, The total loss function during the optimization of the style transfer network model is expressed as: ; in, L ( G X , G Y , D X , D Y ,D t ,X,Y ) represents the total loss function, G X This refers to the first generator. G Y This represents the second generator. X Represents content image, Y Representing style images, D X This refers to the first discriminator. D Y This refers to the second discriminator. D t This refers to the third discriminator. L cyc ( G X , G Y ) represents the loss between the input and output images of the style transfer network model. L GAN ( G X , G Y , D X , D Y ,D t ,X,Y ) indicates resistance to loss. λ This represents the weighting coefficient.
5. The shipwreck detection method according to claim 3, characterized in that, The random color shift operation is represented as follows: F rcs ( I rgb )=(1- α )( β 1× I r + β 2× I g + β 3× I b )+ α ×C; Where C represents the grayscale image of the image to be subjected to random color shifting. F rcs ( I rgb () represents the image after a random color shift operation. I r This represents the pixel value of the R channel of the image to be subjected to random color shifting. I g This represents the pixel value of the G channel of the image to be subjected to random color shifting. I b This represents the pixel value of the B channel of the image to be subjected to random color shifting. α This represents the first weight parameter. β 1 indicates the second weight parameter. β 2 indicates the third weight parameter. β 3 indicates the fourth weighting parameter.
6. The shipwreck detection method according to claim 1, characterized in that, The target detection network includes a backbone network, a feature fusion module, and a detection head. The backbone network is used to extract features from the input image at different scales. The feature fusion module is used to fuse features from the feature maps of different scales output by the backbone network. The detection head is used to output the detection results. The detection head is the detection head of the FCOS network.
7. The shipwreck detection method according to claim 6, characterized in that, The step of training the target detection network based on the style transfer dataset and the side-scan sonar simulation images to obtain the target detection model specifically includes: The content images in the content image dataset and the side-scan sonar simulation images are combined to form a first training set. The target detection network is trained using the first training set to obtain a pre-trained model. A set number of content images are extracted from the content image dataset. The set number of content images and the images in the style image dataset are combined to form a second training set. The detection head of the pre-trained model is trained using the second training set to obtain the target detection model.
8. A shipwreck detection system, characterized in that, include: A style transfer dataset module is used to construct a style transfer dataset. The style transfer dataset includes a content image dataset and a style image dataset. The content images in the content image dataset are side-scan sonar images of the shipwreck in well-water conditions with annotations. The style images in the style image dataset are side-scan sonar images of the shipwreck in turbid water conditions without annotations. The turbidity of the turbid water is greater than that of the well-water conditions. The side-scan sonar simulation image generation module is used to generate side-scan sonar simulation images of the shipwreck in turbid waters using a style transfer network model based on the content image dataset and the style image dataset. The target detection network training module is used to train the target detection network based on the style transfer dataset and the side-scan sonar simulation image to obtain the target detection model; The side-scan sonar image acquisition module under the water area to be detected is used to acquire side-scan sonar images under the water area to be detected. The target detection model includes a shipwreck detection module, which inputs the side-scan sonar image of the water area to be detected into the target detection model to obtain the shipwreck detection result.
9. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the shipwreck detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the shipwreck detection method as described in any one of claims 1 to 7.