An underwater target detection method based on self-supervised collaborative reconstruction

Through the self-supervised collaborative reconstruction method, combined with underwater data collection and network pre-training, the problem of poor adaptability of underwater target detection models is solved, and high-precision target detection in underwater environments is achieved.

CN115439738BActive Publication Date: 2025-10-21BROAD TECH (YANCHENG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211065189.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-01
Publication Date
2025-10-21
Estimated Expiration
2042-09-01

AI Technical Summary

Technical Problem

Existing technologies have poor adaptability of target detection models in underwater environments, resulting in low accuracy. This is mainly due to the scarcity of underwater data and the poor quality of optical camera acquisition. Existing methods are not robust enough in underwater scenes.

Method used

A self-supervised collaborative reconstruction method is adopted to collect data through optical cameras and underwater unmanned vehicles. The self-supervised collaborative reconstruction network and data enhancement technology are combined to construct an underwater target detection network. Contrastive learning and pixel reconstruction tasks are used for pre-training, the feature encoder weights are optimized, and detection is performed by combining the feature pyramid network and the detector head network.

Benefits of technology

In the case of less data, the accuracy and robustness of underwater target detection are improved, the distribution of underwater environmental characteristics is adapted, the mismatch problem between classification confidence and positioning accuracy is avoided, and better visual representation learning is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115439738B_ABST
    Figure CN115439738B_ABST
Patent Text Reader

Abstract

The application discloses an underwater target detection method based on self-supervised collaborative reconstruction, comprising: acquiring a small amount of picture data of an underwater scene; labeling the data of the underwater scene, and using a data enhancement method to obtain a large amount of pre-training data from the labeled data; building a self-supervised collaborative reconstruction network, optimizing the parameters of a feature extraction network on a pre-training data set after passing through a pixel reconstruction branch and a contrast learning branch, so that the feature extraction network is adapted to the data distribution of the underwater scene; establishing an underwater target detection model, using the pre-training optimized feature extraction network, improving the adaptability of the network to the underwater scene, adding a feature pyramid network and a detection head network after the feature extraction network, saving the weight model and performing model reasoning after completing the training of the detection model, and outputting the detection result of the underwater scene. The application can effectively cope with the problem of insufficient underwater data, and effectively improve the adaptability of the detection model in the underwater scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an underwater target detection method based on self-supervised collaborative reconstruction, and belongs to the technical fields of computer vision, deep learning, self-supervised learning and target detection. Background Art

[0002] The ocean, the birthplace of life, holds a vast reservoir of minerals and biological resources. Effective exploration and development of marine resources plays a crucial role in promoting economic development and alleviating the depletion of natural resources. With the advancement of deep learning, object detection technology has been applied to numerous fields. Underwater robots equipped with intelligent object detection systems have become an effective means of exploring the ocean. However, due to the influence of the underwater environment, underwater robots equipped with optical cameras struggle to collect large amounts of high-quality underwater data. Furthermore, the complex and ever-changing underwater environment, with light reflection and scattering, exacerbates the problem of poor underwater image quality. These adverse effects limit the application of object detection technology in underwater scenarios.

[0003] Deep learning has witnessed an explosive growth in model parameters. This often requires extensive data support. Existing object detection techniques mostly use weights pre-trained on the large ImageNet dataset to initialize feature extraction networks, failing to account for the unique characteristics of underwater scenarios. ROIMix, the winning solution for underwater object detection at URPC2019, simulates mutual occlusion by underwater creatures and mixes different data to mimic real-world data distribution. FERNet is an underwater object detection solution presented at ECCV2020. Building on RFBNet, the authors expanded the network's receptive field and cascaded the backbone to improve the network's feature extraction capabilities. These methods are mostly based on general object detection methods and lack robustness in underwater scenarios. Furthermore, due to the relative difficulty of collecting underwater data, it is difficult to obtain sufficient data to train the models. Therefore, directly applying these detectors to underwater object detection tasks often results in significant accuracy degradation and other issues. Summary of the Invention

[0004] In order to address the shortcomings of the existing technology, the purpose of the present invention is to provide an underwater target detection method based on self-supervised collaborative reconstruction, which solves the problem in the existing technology of low accuracy due to the scarcity of underwater data and the poor adaptability of the detection model in underwater scenes.

[0005] In order to achieve the above objectives, the present invention adopts the following technical solutions:

[0006] A method for underwater target detection based on self-supervised collaborative reconstruction, comprising the following steps:

[0007] The required underwater image data is collected through optical cameras and underwater unmanned vehicles to form an underwater data set p1;

[0008] The acquired data is labeled and the data set is expanded using data augmentation methods to form a pre-training data set;

[0009] Build a self-supervised collaborative reconstruction network, combine contrastive learning with pixel reconstruction tasks, and pre-train on underwater datasets to adapt to underwater object detection tasks;

[0010] Input the aforementioned pre-trained dataset into the self-supervised collaborative reconstruction network and retain the weights of the feature encoder;

[0011] Build an underwater target detection network;

[0012] Initialize the weights of the aforementioned feature encoder and input them into the underwater target detection network. Continuously optimize the detection results through the loss function and save the network weights.

[0013] Use the previously saved network weights for inference to test the network's application effect in underwater scenarios.

[0014] Furthermore, the aforementioned step of using the data augmentation method to expand the data set to form a pre-training data set includes:

[0015] Place the standard colorimetric card in seawater at different depths, limiting its depth to 0 to m meters. Use an underwater camera to take photos of the colorimetric card every 1 meter and record the depth value corresponding to each photo. Finally, a standard photo set P2 with the colorimetric card is obtained.

[0016] All the data in the underwater dataset p1 and the standard image set p2 with color chart are grayed out, and their pixel values ​​are counted as histogram vectors, which are denoted as H = {H1, H2, ..., H i ,...,H n}、h={h0,h1,...h j ,...,h m}, where H i Represents the grayscale pixel histogram vector of the i-th picture in the underwater dataset p1, h j represents the jth picture with a standard colorimetric card in the standard picture set p2, and n is the size of the underwater dataset;

[0017] The single vector H in H i Calculate the cosine similarity Cos(H i ,h j ), select the maximum value of cosine similarity max(Cos(H i ,h j )) corresponding h j , we can get max(Cos(H i ,hj ))h j The corresponding depth value d, where the calculation formula of cosine similarity Cos and depth value d is as follows:

[0018]

[0019]

[0020] The underwater data enhancement method Sea-thru is used to restore and correct the color of the images in the underwater dataset p1 based on the depth value to obtain the enhanced image data;

[0021] After completing color restoration and correction, random cropping, random rotation, and random scale transformation are used to further expand the dataset to obtain the final underwater pre-training dataset.

[0022] Furthermore, the calculation formula of the aforementioned underwater data enhancement method Sea-thru is:

[0023] out=f(in,d)

[0024] Among them, f is the Sea-thru data enhancement method, in represents the image in the underwater dataset p1, d is the depth value corresponding to in, and out represents the enhanced image.

[0025] Furthermore, the aforementioned self-supervised collaborative reconstruction network includes a contrastive learning branch and a pixel reconstruction branch;

[0026] The contrastive learning branch includes an online sub-branch and a target sub-branch: the online sub-branch includes a feature encoder, two linear projection layers, and a predictor; the target sub-branch includes a feature encoder and a linear projection layer.

[0027] Furthermore, the loss function expression for the aforementioned pre-training on the underwater dataset is:

[0028] L=L contrast +L reconstruct

[0029]

[0030]

[0031] Where q is the view of the online sub-branch, L is the total loss function, and L contrast is the loss function of the contrastive learning branch, L reconstruct is the loss function of the pixel reconstruction branch, k + is the target feature of different views of the same image, ki is the target feature of the i-th negative sample, τ is the temperature coefficient, K is the queue size, N is the size of the image batch, decoder represents the feature decoder of the pixel reconstruction branch, z is the output of the feature encoder, λ is the balance coefficient, and img refers to the input image.

[0032] Furthermore, the aforementioned underwater target detection network includes a feature extraction network, a feature pyramid network, and a detector head network;

[0033] The feature extraction network selects the residual network ResNet50, extracts the last three layers C3, C4, and C5 output by the feature extraction network and feeds them into the feature pyramid network;

[0034] Based on the inputs of C3, C4, and C5 in the feature extraction network, the P3, P4, and P5 levels of the feature pyramid network are calculated. On the basis of C5, a convolution layer with a step size of 2 and a convolution kernel size of 3 is used to obtain the P6 level of the feature pyramid network. On the basis of P6, a ReLU layer is applied, and then a convolution layer with a step size of 2 and a convolution kernel size of 3 is used to obtain the P7 level of the feature pyramid network.

[0035] The five feature levels obtained from the feature pyramid network are fed into the detector head network to obtain the target position, target category, target center and target IOU in the input image.

[0036] Furthermore, the aforementioned detector head network includes a classification branch and a regression branch;

[0037] The classification branch is responsible for outputting the confidence and centrality of each object category. The calculation formula of centrality is defined as:

[0038]

[0039] Where l represents the distance from the pixel in the annotation box to the left boundary, r represents the distance from the pixel in the annotation box to the right boundary, t represents the distance from the pixel in the annotation box to the upper boundary, and b represents the distance from the pixel in the annotation box to the lower boundary.

[0040] The regression branch is used to predict the coordinate position of the object in the image and output an IOU prediction value. The IOU calculation formula is:

[0041]

[0042] Where A and B represent the candidate box and the annotation box respectively, ∩ represents the intersection, and ∪ represents the union.

[0043] Furthermore, the total loss function of the aforementioned underwater detection network is:

[0044]

[0045] where N pos Indicates the number of positive samples, L cls represents the classification loss, L reg represents the regression loss, L iou represents the intersection-over-union loss, L cnt represents the centrality loss.

[0046] Furthermore, the steps of initializing the weights of the feature encoder and inputting them into the underwater target detection network, continuously optimizing the detection results through the loss function, and saving the network weights include:

[0047] Initialize the previously saved feature encoder weights;

[0048] After random color jittering and random cropping, it is input into the underwater target detection network;

[0049] The parameters of the entire network are optimized through loss calculation and gradient backpropagation, and the network weights are saved after training is completed.

[0050] Furthermore, the steps of using the aforementioned saved network weights for inference and testing the application effect of the network in underwater scenarios are as follows:

[0051] Multiply the IOU, center, and confidence of the above detection outputs, and sort the detection boxes according to the results;

[0052] The first 80 results with the largest values ​​are selected for non-maximum suppression processing to obtain the final detection results.

[0053] The beneficial effects achieved by the present invention are:

[0054] The present invention is an underwater target detection method that integrates self-supervised learning. It can effectively target underwater environments, enabling the network to learn better visual representations. Using less data, it can achieve better results than ImageNet pre-training. Through self-supervised collaborative reconstruction, while performing comparative learning, it is optimized together with pixel reconstruction. This allows the network to learn global features while also taking into account the importance of local spatial features. Because it uses underwater datasets for pre-training, it is more adaptable to the feature distribution of underwater datasets. Furthermore, the pre-training process optimizes the parameters of the feature extraction network and does not increase the time consumption during the inference process. The predicted center and IOU in the detection head network avoid directly using confidence to filter the generated prediction results, resolving the mismatch between classification confidence and positioning accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 is a flow chart of the present invention;

[0056] Figure 2 This is a diagram showing the specific implementation process of the self-supervised collaborative reconstruction network and the underwater target detection network of the present invention;

[0057] Figure 3 This is a structural diagram of the self-supervised collaborative reconstruction network of the present invention;

[0058] Figure 4 This is a structural diagram of the underwater target detection network of the present invention;

[0059] Figure 5 This is a comparison chart of the effects of the depth-adaptive underwater data enhancement method applied in the present invention;

[0060] Figure 6 This is the visualization result of the present invention in the underwater target detection competition URPC. DETAILED DESCRIPTION

[0061] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application. Unless there is a conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.

[0062] In an embodiment of the present invention, a method for underwater target detection based on self-supervised collaborative reconstruction is provided. Figure 1 and Figure 2 As shown, the following steps are included:

[0063] Step 1: Collect the required underwater image data using an optical camera and an underwater unmanned vehicle to form an underwater dataset p1.

[0064] Step 2: Use the CVAT annotation tool to annotate the collected underwater pictures so that they contain category information and coordinate information. The annotation format is COCO format, that is, saved as a json file. After the annotation is completed, the data set is expanded using the data enhancement method and cropped according to the annotated pixel coordinates to form a pre-training data set. Data enhancement methods include Sea-thru, random cropping, random rotation, and random scale transformation. The existing underwater data enhancement method Sea-thru requires the input of the depth value of the picture underwater. However, common RGB pictures cannot give the depth value of their shooting. Due to this feature, the usability of Sea-thru is greatly reduced. Therefore, the present invention provides a solution to improve Sea-thru into a depth-adaptive data enhancement method, thereby improving the usability of Sea-thru. The main steps of data enhancement are as follows:

[0065] Step 2-1: Place a standard colorimetric chart in seawater at varying depths, ranging from 0 to m meters. Use an underwater camera to take photos of the colorimetric chart every 1 meter. This will yield a standard image set P2 containing m + 1 photos. Ensure the colorimetric chart is facing the camera lens during the photo shoot, and record the depth corresponding to each photo.

[0066] Step 2-2: Grayscale all the data in the underwater dataset p1 and the standard image set p2 with color charts, and calculate the histogram vectors according to their pixel values, denoted as H, h respectively, where H = {H1, H2, ..., H i ,...,H n}、h={h0,h1,...h i ,...,h m}, where H i Represents the grayscale pixel histogram vector of the i-th picture in the underwater dataset p1, h j represents the j-th grayscale pixel histogram vector in the standard image set p2, and n is the size of the underwater dataset.

[0067] Step 2-3: Substitute a single vector H in H i Calculate the cosine similarity Cos(H i ,h j ), select the maximum value of cosine similarity max(Cos(H i ,h j )) corresponding h j , from step 2-1, we can get max(Cos(H i ,h j ))h j The corresponding depth value d is the depth value corresponding to the i-th image in the underwater dataset p1. The calculation formula of cosine similarity Cos and depth value d is as follows:

[0068]

[0069]

[0070] Step 2-4: Use the existing underwater data enhancement method Sea-thru to restore and correct the color of the image in the underwater dataset p1 based on the depth value d to obtain the enhanced image data. The effect is as follows Figure 5 The process is expressed as follows:

[0071] out=f(in,d)

[0072] Among them, f is the Sea-thru data enhancement method, in represents the image in the underwater dataset p1, d is the depth value corresponding to in, and out represents the enhanced image.

[0073] Steps 2-5: After completing color restoration and correction, use random cropping, random rotation, and random scale transformation to further expand and obtain the final underwater pre-training dataset.

[0074] Step 3: Build a self-supervised collaborative reconstruction network, such as Figure 3 shown.

[0075] The network consists of two branches, the contrastive learning branch and the pixel reconstruction branch. The contrastive learning branch consists of an online sub-branch and a target sub-branch: the online sub-branch includes a feature encoder (Encoder, using ResNet50) and two linear projection layers (Projector and Predictor), and the target sub-branch includes a feature encoder (Encoder, using ResNet50) and a linear projection layer (Projector). The two linear projection layers, Projector and Predictor, are composed of two convolution layers with a convolution kernel size of 1×1, a batch normalization layer BN and a RELU layer. The Projector is a 2-layer MLP linear projection layer. The additional MLP projection layer introduced in the online branch gives the two branches an asymmetric structure, which can effectively suppress the solution collapse phenomenon in self-supervised learning and improve the feature extraction capability of the feature encoder. The online branch is updated by gradient, while the target branch is updated by the exponential moving average of the online branch.

[0076] Different views obtained by data augmentation methods are input into the self-supervised collaborative reconstruction network. These views output corresponding feature vectors through the contrast learning branch and the pixel reconstruction branch, and are pre-trained to adapt to the underwater target detection task.

[0077] In order to prevent the solution of the model from degenerating into a constant, a large number of negative samples are also set in the network. Specifically, the enhanced views created from the same sample are considered as positive sample pairs, and the views from different samples are considered as negative sample pairs. The loss function is used to reduce the difference between positive samples and increase the distance between negative samples. The loss function is defined as the difference between the feature vectors output by the two branches. Among them, the contrastive learning branch loss function L contrast is defined as:

[0078]

[0079] Among them, q is the view of the online sub-branch, k + is the target feature of different views of the same image, k iRepresents the target feature of the view between different images, that is, the target feature of the i-th negative sample, τ is the temperature coefficient, and K is the queue size, that is, batchsize.

[0080] The pixel reconstruction branch adds a mask to the feature map fed into the feature encoder, and reconstructs the missing pixel values ​​through a lightweight feature decoder to improve the network's sensitivity to local spatial features. That is, the values ​​in the feature map matrix are directly set to 0, and the ratio of mask addition is 50%. The feature decoder contains a linear nearest neighbor interpolation, a convolution layer with a convolution kernel size of 3×3, and a dimensionality transformation. Linear nearest neighbor interpolation is used for upsampling to restore the dimension of the feature map before downsampling in the feature extraction network. The convolution layer is used to eliminate the aliasing effect caused by upsampling. Dimension transformation is used to adjust the dimension of the image to facilitate loss calculation with the original image. The loss of the pixel reconstruction branch uses the mean square error (MSE), and its loss function L reconstruct The calculation formula is as follows:

[0081]

[0082] Where N is the batch size, img is the input image, decoder is the feature decoder of the pixel reconstruction branch, z is the output of the feature encoder, and λ is the balancing coefficient.

[0083] Contrastive learning excels at capturing global features of an image, while pixel reconstruction focuses on local spatial information. Therefore, the self-supervised collaborative reconstruction network effectively combines the advantages of both, learning more robust visual representations. The overall loss function is a combination of these two, expressed as follows:

[0084] L=L contrast +L reconstruct .

[0085] Step 4: Input the pre-trained dataset obtained in Step 2 into the self-supervised collaborative reconstruction network to train the feature encoder. The hardware selected was a host equipped with a single 3090 GPU and 32GB of memory. The deep learning framework used was PyTorch, and the programming language was Python. The batch size was set to 512, the learning rate to 0.0025, and the optimizer used stochastic gradient descent (SGD) for a total of 50 epochs. A linear learning rate warmup strategy was used for the first five epochs, and the learning rate was decayed from 0.0025 to 0 for the next 45 epochs. After network training, the corresponding feature encoder weights were saved.

[0086] Step 5: Build an underwater target detection network, the main structure is as follows Figure 4As shown in the figure, the network consists of a feature extraction network, a feature pyramid network, and a detector head network. The feature extraction network uses the residual network ResNet50, and the last three layers of its output, C3, C4, and C5, are selected as input to the feature pyramid network. The feature pyramid network outputs five levels: P3, P4, P5, P6, and P7. P3 to P5 are computed from the outputs of C3 to C5 in ResNet50 using a top-down and lateral connection structure. P6 is obtained by applying a convolutional layer with a stride of 2 and a kernel size of 3 to C5. P7 is obtained by applying a ReLU layer to P6, followed by a convolutional layer with a stride of 2 and a kernel size of 3. The five feature levels obtained from the feature pyramid network are fed into the detector head network to produce the corresponding detection results, which include object location, object category, object centerness, and object inter-connection-over-union in the input image. The detector head network has two branches: classification and regression. The classification branch is mainly responsible for outputting the confidence and center of each object category. Both confidence and center are numbers between 0 and 1. The regression branch is used to predict the coordinate position of the object in the image and output an IOU prediction value. This allows the inference stage to avoid directly using confidence to sort the candidate boxes, effectively reducing the risk of high-quality candidate boxes being filtered. Among them, the center and IOU prediction values ​​generate labels during the training process and are optimized as the loss function is optimized. The calculation formula of the center is defined as:

[0087]

[0088] Here l represents the distance from the pixel in the annotation box to the left boundary, r represents the distance from the pixel in the annotation box to the right boundary, t represents the distance from the pixel in the annotation box to the upper boundary, and b represents the distance from the pixel in the annotation box to the lower boundary.

[0089] The calculation formula for IOU is as follows:

[0090]

[0091] Where A and B represent the candidate box and the annotation box respectively, ∩ represents the intersection, and ∪ represents the union.

[0092] The total loss function of the underwater target detection network is defined as follows:

[0093]

[0094] where N pos Indicates the number of positive samples, L cls Represents classification loss, using Focal Loss, L reg Represents regression loss, using GIOU Loss. For intersection-over-union loss Liou Use Smooth-L1 loss, center loss L cnt Using cross entropy loss (Cross Entropy Loss), x and y represent the predicted value of the network and the true value of the annotation, respectively.

[0095] Step 6: According to the above structure, use the pytorch deep framework to build the network, such as Figure 4 As shown. The hardware still uses the host computer in step 3. During training, the learning rate is set to 0.005, the weight decay coefficient is set to 0.0005, and the batch size is set to 8. To adapt to the underwater target detection task, the feature encoder weights saved in step 4 are used for initialization. After random color jittering and random cropping, the input is fed into the detection network. After loss calculation and gradient backpropagation, the parameters of the entire network are optimized. After training, the network weights are saved. A total of 36 rounds of training are conducted. A linear learning rate warm-up strategy is used in the first 500 iterations. The learning rate is decayed once in the 27th and 33rd rounds, each decay being 10 times the previous one.

[0096] Step 7: The present invention conducts experiments in the underwater target detection competition URPC, uses the network weights saved in step 6 for inference, multiplies the IOU, center and confidence of the detection output, sorts the detection boxes according to the results, selects the top 80 results with the largest values ​​for NMS (non-maximum suppression) processing, and obtains the final detection results. Some of the detection results are shown in the figure below. Figure 6 shown.

[0097] In order to verify the real-time performance of this algorithm, relevant comparative experiments were set up. Table 1 summarizes the mAP evaluation results of each algorithm in the underwater target detection competition URPC.

[0098] Table 1

[0099] algorithm mAP (%) Feature extraction network Cascade R-CNN 81.6 CB-Res2Net-101-DCN FCOS 73.4 ResNet-50 Sparse R-CNN 78.2 Swin-Base GFocal V2 79.8 Res2Net-101-DCN DetectoRS 74.4 ResNeXt-101-32x4d RepPoints 78.9 ResNet-50 YOLOV3 75.0 DarkNet-53 SSD 73.8 VGG-16 RetinaNet 77.3 ResNet-50 FoveaBox 78.2 ResNet-50 ATSS 78.0 ResNet-50 PAA 80.3 ResNeXt-101-64x4d-DCN CenterNet V2 74.5 R2-101-DCN-BiFPN DoubleHead 77.5 ResNet-101 Ours 82.3 ResNet-50

[0100] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for underwater target detection based on self-supervised collaborative reconstruction, characterized in that: The following steps are involved: The required underwater image data is collected through optical cameras and underwater unmanned vehicles to form an underwater data set p1; The acquired data is labeled and the data set is expanded using data augmentation methods to form a pre-training data set; A self-supervised collaborative reconstruction network is built, which combines contrastive learning with pixel reconstruction tasks and is pre-trained on underwater datasets to adapt to underwater target detection tasks. The self-supervised collaborative reconstruction network includes a contrastive learning branch and a pixel reconstruction branch; the contrastive learning branch includes an online sub-branch and a target sub-branch: the online sub-branch includes a feature encoder, two linear projection layers, and a predictor; the target sub-branch includes a feature encoder and a linear projection layer; the pixel reconstruction branch includes a feature decoder for adding a mask to the feature map fed into the feature encoder and reconstructing the missing pixel values ​​of the feature map; the feature decoder includes a linear nearest neighbor interpolation, a convolution layer with a convolution kernel size of 3×3, and a dimensionality transformation; Input the aforementioned pre-trained dataset into the self-supervised collaborative reconstruction network and retain the weights of the feature encoder; Build an underwater target detection network; Initialize the weights of the aforementioned feature encoder and input them into the underwater target detection network. Continuously optimize the detection results through a loss function, and save the network weights. The loss function is the sum of the contrastive learning branch loss function and the pixel reconstruction branch loss function. Use the previously saved network weights for inference to test the network's application effect in underwater scenarios.

2. The underwater target detection method based on self-supervised collaborative reconstruction according to claim 1 is characterized in that: The step of using the data enhancement method to expand the data set to form a pre-training data set includes: Place the standard colorimetric card in seawater at different depths, limiting its depth to 0 to m meters. Use an underwater camera to take photos of the colorimetric card every 1 meter and record the depth value corresponding to each photo. Finally, a standard photo set P2 with the colorimetric card is obtained. All the data in the underwater dataset p1 and the standard image set p2 with color chart are grayed out, and their pixel values ​​are counted as histogram vectors, which are recorded as H={H1, H2, ... , H i , ... , H n }、h={h0,h1, ... h j , ... , h m }, where H i Represents the grayscale pixel histogram vector of the i-th picture in the underwater dataset p1, h j represents the jth picture with a standard colorimetric card in the standard picture set p2, and n is the size of the underwater dataset; The single vector H in H i Calculate the cosine similarity with all vectors in h respectively , select the maximum cosine similarity The corresponding h j , we can conclude Medium h j The corresponding depth value d, where the calculation formula of cosine similarity Cos and depth value d is as follows: , , The underwater data enhancement method Sea-thru is used to restore and correct the color of the images in the underwater dataset p1 based on the depth value to obtain the enhanced image data; After completing color restoration and correction, random cropping, random rotation, and random scale transformation are used to further expand the dataset to obtain the final underwater pre-training dataset.

3. The underwater target detection method based on self-supervised collaborative reconstruction according to claim 2 is characterized in that: The calculation formula of the underwater data enhancement method Sea-thru is: , Among them, f is the Sea-thru data enhancement method, in represents the image in the underwater dataset p1, d is the depth value corresponding to in, and out represents the enhanced image.

4. The underwater target detection method based on self-supervised collaborative reconstruction according to claim 1 is characterized in that: The loss function expression for pre-training on the underwater dataset is: , , , Where q is the view of the online sub-branch, L is the total loss function, is the loss function of the contrastive learning branch, is the loss function of the pixel reconstruction branch, k + is the target feature of different views of the same image, k i is the target feature of the i-th negative sample, τ is the temperature coefficient, K is the queue size, N is the size of the image batch, decoder represents the feature decoder of the pixel reconstruction branch, z is the output of the feature encoder, λ is the balance coefficient, and img refers to the input image.

5. The underwater target detection method based on self-supervised collaborative reconstruction according to claim 4 is characterized in that: The underwater target detection network includes a feature extraction network, a feature pyramid network and a detector head network; The feature extraction network selects the residual network ResNet50, extracts the last three layers C3, C4, and C5 output by the feature extraction network and feeds them into the feature pyramid network; Based on the inputs of C3, C4, and C5 in the feature extraction network, the P3, P4, and P5 levels of the feature pyramid network are calculated. On the basis of C5, a convolution layer with a step size of 2 and a convolution kernel size of 3 is used to obtain the P6 level of the feature pyramid network. On the basis of P6, a ReLU layer is applied, and then a convolution layer with a step size of 2 and a convolution kernel size of 3 is used to obtain the P7 level of the feature pyramid network. The five feature levels obtained from the feature pyramid network are fed into the detector head network to obtain the target position, target category, target center and target IOU in the input image.

6. The underwater target detection method based on self-supervised collaborative reconstruction according to claim 5 is characterized in that: The detector head network includes a classification branch and a regression branch; The classification branch is responsible for outputting the confidence and centrality of each object category. The calculation formula of centrality is defined as: , Where l represents the distance from the pixel in the annotation box to the left boundary, r represents the distance from the pixel in the annotation box to the right boundary, t represents the distance from the pixel in the annotation box to the upper boundary, and b represents the distance from the pixel in the annotation box to the lower boundary. The regression branch is used to predict the coordinate position of the object in the image and output the IOU prediction value. The IOU calculation formula is: , Where A and B represent the candidate box and the annotation box respectively, ∩ represents the intersection, and ∪ represents the union.

7. The underwater target detection method based on self-supervised collaborative reconstruction according to claim 6 is characterized in that: The total loss function of the underwater detection network is: , Among them, N pos Indicates the number of positive samples, L cls represents the classification loss, L reg represents the regression loss, L iou represents the intersection-over-union loss, L cnt represents the centrality loss.

8. The underwater target detection method based on self-supervised collaborative reconstruction according to claim 7 is characterized in that: The steps of initializing the weights of the feature encoder and inputting them into the underwater target detection network, continuously optimizing the detection results through the loss function, and saving the network weights include: Initialize the previously saved feature encoder weights; After random color jittering and random cropping, it is input into the underwater target detection network; The parameters of the entire network are optimized through loss calculation and gradient backpropagation, and the network weights are saved after training is completed.

9. The underwater target detection method based on self-supervised collaborative reconstruction according to claim 8, characterized in that: The steps of using the aforementioned saved network weights for inference and testing the application effect of the network in the underwater scene are as follows: Multiply the IOU, center, and confidence of the above detection outputs, and sort the detection boxes according to the results; The first 80 results with the largest values ​​are selected for non-maximum suppression processing to obtain the final detection results.

Citation Information

Patent Citations

  • Super-resolution image reconstruction method and device, electronic device and storage medium

    CN109118430A

  • Underwater target detection method based on spatial feature self-supervision

    CN114663683A