Ocean image denoising method based on SwinIR

Through the ocean image denoising method based on SwinIR, combined with mask training and latent bridging network, it solves the problem of poor recognition effect of traditional image denoising models in the ocean environment, achieves efficient denoising and detail retention of ocean images, and improves recognition performance and device performance.

CN117670714BActive Publication Date: 2024-08-23QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES) +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311659643.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-06
Publication Date
2024-08-23
Estimated Expiration
2043-12-06

AI Technical Summary

Technical Problem

Traditional image denoising models are not effective in marine image processing and cannot effectively identify targets in the marine environment, resulting in information loss and misidentification, and unable to provide real-time early warning of maritime threats.

Method used

The ocean image denoising method based on SwinIR is used to build an ocean image denoising network model through a shallow feature extraction module, a residual module, a semi-supervised shallow bridge module, a deep feature extraction module, a high-quality image reconstruction module and an upsampling unit. Combined with Mask training and latent bridging networks to achieve denoising and detail preservation of ocean images.

Benefits of technology

It effectively eliminates noise in ocean images, improves image clarity and edge naturalness, achieves real-time recognition and lightweight device performance, has strong generalization capabilities, and is better than the PSNR, SSIM and LPIPS indicators of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117670714B
    Figure CN117670714B
Patent Text Reader

Abstract

A method for denoising ocean images based on SwinIR relates to the field of image processing technology. Based on the Swin-Transformer structure, a latent bridge network module of semi-supervised learning is used to implement mask training of a self-built data set. During the training process, mask training is performed using labeled data and real-world unlabeled data. The mask training uses random masks, which effectively solves the generalization problem of ocean images in denoising networks. At the same time, the added latent bridge module can also bridge the domain gap between labeled data and unlabeled data, thereby achieving real-time performance on lightweight devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an ocean image denoising method based on SwinIR. Background Art

[0002] Image denoising and recognition are fundamental issues in the field of computer vision. With the continuous deepening of human cognition of the ocean and the continuous development of technology, ocean image analysis technology has become the most effective and economical means of detecting ocean information. However, due to the complexity and variability of the marine environment, traditional image analysis technology faces the challenge of being unable to meet the needs of ocean image information processing. In recent years, research on ocean image analysis technology based on deep learning has become a hot topic in the current field of marine remote sensing. By applying deep learning technology, accurate recognition of ocean images can be achieved, thereby better understanding and utilizing marine resources, and providing strong support for marine environmental protection and sustainable development.

[0003] Common image denoising is generally based on land images, while ocean images are relatively rare. The main reason is that the ocean environment is complex and changeable, and ocean images are different from land images. In the process of collecting ocean images, they will be affected by many unique ocean environments, such as sunlight, fog, sea fog and strong winds. These factors will have an adverse effect on the clarity and quality of ocean images, resulting in information loss and misrecognition of ocean images.

[0004] However, in most previous image denoising models, training and evaluation were mainly performed on images corrupted by Gaussian noise. Although these methods achieved good performance, in the process of model building, due to the complexity of noise, they may be limited by a single noise distribution, which may cause the model to be unable to be extended to ocean images and unable to accurately identify different targets in the ocean in real time. At the same time, it also leads to the inability to accurately judge abnormal situations in ocean information monitoring, and thus the inability to issue timely warnings of maritime threats. Summary of the invention

[0005] In order to overcome the deficiencies of the above technologies, the present invention provides a SwinIR-based ocean image denoising method that can eliminate severe noise damage and retain image details.

[0006] The technical solution adopted by the present invention to overcome the technical problems is:

[0007] A method for denoising ocean images based on SwinIR comprises the following steps:

[0008] a) Obtain n original ocean noise images, and obtain the original ocean image set A0, A0 = {A1, A2, ..., A i ,...,A n}, Ai is the i-th original ocean noise image, i∈{1,...,n}, A i ∈R H×W×C , R is the real number space, W is the width of the i-th original ocean noise image, and H is the height of the i-th original ocean noise image;

[0009] b) Take the i-th original ocean noise image A i Preprocessing is performed to obtain the i-th preprocessed original ocean noise image A i ′, the preprocessed ocean image set is A0′, A0′={A1′,A2′,...,A i ′,...,A n ′}; c) dividing the preprocessed ocean image set A0′ into a training set and a test set;

[0010] d) Establishing an ocean image denoising network model, which consists of a shallow feature extraction module in the SwinIR model, a first residual module, a semi-supervised shallow bridge module, a second residual module, a deep feature extraction module in the SwinIR model, a high-quality image reconstruction module in the SwinIR model, and an upsampling unit;

[0011] e) The i-th preprocessed original ocean noise image A in the training set i ′ is input into the shallow feature extraction module and residual module of the ocean image denoising network model, and the feature map A is output Q1 , residual image A′ Q1-1-R And the residual image A′ Q1-1-R The labeled image latent space M L ;

[0012] f) The residual image A′ Q1-1-R Input into the semi-supervised shallow bridge module and the second residual module of the ocean image denoising network model, and output the unlabeled residual image A′ Q3-R-M And the unlabeled residual image A′ Q3-R-M The labeled image latent space M UL ;

[0013] g) The unlabeled residual image A′ Q3-R-M Input into the deep feature extraction module of the ocean image denoising network model, and output the feature map A Q4 ;

[0014] h) The feature map A Q4 Input to the high-quality image reconstruction module of the ocean image denoising network model, and output the feature map A Q4-R ;

[0015] i) The feature map AQ4-R Input into the upsampling unit of the ocean image denoising network model, and output the denoised image A des ;

[0016] j) calculating the total loss function L, training the ocean image denoising network model according to the total loss function, and obtaining an optimized ocean image denoising network model;

[0017] k) Take the i-th preprocessed original ocean noise image A in the test set i ′ is input into the optimized ocean image denoising network model, and the denoised image A is output d ' es .

[0018] Furthermore, in step a), n original ocean noise images are obtained from the WSODD dataset to obtain an original image set A0.

[0019] Further, step b) comprises the following steps:

[0020] b-1) Take the i-th original ocean noise image A i Crop to 128×128 pixels;

[0021] b-2) The cropped image is randomly rotated 90° and then randomly rotated 180° to obtain the i-th preprocessed original ocean noise image A i ′.

[0022] Furthermore, in step c), the preprocessed ocean image set A0′ is divided into a training set and a test set in a ratio of 3:1.

[0023] Further, step e) comprises the following steps:

[0024] e-1) Take the i-th preprocessed original ocean noise image A in the training set i ′ is input into the shallow feature extraction module of the ocean image denoising network model, and the output is the feature map A Q1 ;

[0025] e-2) The feature map A Q1 Input it into the residual module of the ocean image denoising network model, and use the getrandbits function in Python's random library to perform random sampling on the feature map A. Q1 Perform a random mask operation to obtain the masked labeled noise image A Q1-1 ;

[0026] e-3) Use the fastN1MeansDenoising function in Python's OpenCV library to denoise the image and obtain the labeled denoised image A Q1-1-R ;

[0027] e-4) The masked labeled noise image A Q1-1 With the labeled denoised image A Q1-1-R Perform a subtraction operation to obtain the residual image A′ Q1-1-R ;

[0028] e-5) Use the absdiff function in Python's OpenCV library to calculate the residual image A′ Q1-1-R Extract the residual and get the labeled image latent space M L .

[0029] Further, step f) comprises the following steps:

[0030] f-1) The semi-supervised shallow bridge module of the ocean image denoising network model consists of the first two-dimensional convolutional layer, the second two-dimensional convolutional layer, the third two-dimensional convolutional layer, the maximum pooling layer, and the fully connected layer;

[0031] f-2) The feature map A Q1 Input into the first two-dimensional convolutional layer of the semi-supervised shallow bridge module, and output the feature map A′ Q ″ 1-1-R ;

[0032] f-3) The feature map A′ Q ″ 1-1-R Input into the second 2D convolutional layer of the semi-supervised shallow bridge module, and output the feature map A Q2 ;

[0033] f-4) The feature map A Q2 Input into the third 2D convolutional layer of the semi-supervised shallow bridge module, and output the feature map A′ Q2-1-R ;

[0034] f-5) The feature map A′ Q2-1-R Input into the maximum pooling layer of the semi-supervised shallow bridge module, and output the feature map A Q3 , f-6) The feature map A Q3 Input into the fully connected layer of the semi-supervised shallow bridge module, and output the feature map A′ Q ' 1-1-R ;

[0035] f-7) The feature map A′ Q ' 1-1-R The image is input into the second residual module of the ocean image denoising network model, and the flip function in the Python OpenCV library is used to perform a horizontal flip image enhancement operation with the coordinate axis 1 to obtain the feature map.

[0036] f-8) Use the add function in Python's OpenCV library to add the residual image A' Q1-1-R With feature map Perform the addition operation to obtain the feature map A Q3-R-M ;

[0037] f-9) For feature map A Q3-R-M Use the flip function in Python's OpenCV library to perform a vertical flip image enhancement operation with the coordinate axis at 0 to obtain the feature map

[0038] f-10) The feature map A Q3-R-M With the feature map A′ Q ' 1-1-R Perform a subtraction operation to obtain the unlabeled residual image A′ Q3-R-M ;

[0039] f-11) Use the absdiff function in Python's OpenCV library to analyze the unlabeled residual image A′ Q3-R-M Extract the residual and get the unlabeled residual image A′ Q3-R-M The labeled image latent space M UL .

[0040] Preferably, in step f-2), the convolution kernel size of the first two-dimensional convolution layer is 3×3, the padding is 1, and the step size is 1; in step f-3), the convolution kernel size of the second two-dimensional convolution layer is 3×3, the padding is 1, and the step size is 1; in step f-4), the convolution kernel size of the third two-dimensional convolution layer is 3×3, the padding is 1, and the step size is 1; in step f-5), the pooling kernel size of the maximum pooling layer is 2×2, and the step size is 2; in step f-6), the pooling kernel size of the fully connected layer is 2×2, and the step size is 4.

[0041] Furthermore, in step i), the feature map A Q4-R Input to the upsampling unit of the ocean image denoising network model, and use the PixelShuffle function in Pytorch to shuffle the feature map A Q4-R Perform upsampling to obtain the denoised image A des .

[0042] Further, step j) comprises the following steps:

[0043] j-1) The feature map A Q4 Input into the encoder module of the Transformer network model, and output the H*W feature matrix G;

[0044] j-2) By the formula L=L L1 +λ1L const+λ2L potential The total loss function L is calculated, where L L1 is the regularized loss function, It is a concatenation operation, λ1 and λ2 are weights;

[0045] j-3) Use the Adam optimizer and the total loss function L to train the ocean image denoising network model to obtain the optimized ocean image denoising network model.

[0046] Preferably, the number of iterations when training the ocean image denoising network model is 200K, the learning rate is set to 0.0002, the learning speed is set to decay by 0.8 times every 20 iterations, and the initial learning rate is set to 1×10 -4 , the batch size is set to 64, λ1=0.1, λ2=0.1.

[0047] The beneficial effects of the present invention are as follows: Based on the Swin-Transformer structure, by adopting the semi-supervised learning latent bridge network module, mask training of self-built data sets is realized. During the training process, mask training is performed using labeled data and real-world unlabeled data. Mask training uses random masks, which effectively solves the generalization problem of ocean images in denoising networks. At the same time, the added latent bridge module can also bridge the domain gap between labeled data and unlabeled data, thereby achieving real-time performance on lightweight devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 The present invention is a flow chart of the method. DETAILED DESCRIPTION

[0049] The following is combined with Figure 1 The present invention is further described.

[0050] A method for denoising ocean images based on SwinIR comprises the following steps:

[0051] a) Obtain n original ocean noise images, and obtain the original ocean image set A0, A0 = {A1, A2, ..., A i ,...,A n}, A i is the i-th original ocean noise image, i∈{1,...,n}, A i ∈R H×W×C , R is the real number space, W is the width of the i-th original ocean noise image, and H is the height of the i-th original ocean noise image.

[0052] b) Take the i-th original ocean noise image A iPreprocessing is performed to obtain the i-th preprocessed original ocean noise image A i ′, the preprocessed ocean image set is A0′, A0′={A1′,A2′,...,A i ′,...,A n c) The preprocessed ocean image set A0′ is divided into a training set and a test set.

[0053] d) Establishing an ocean image denoising network model, the ocean image denoising network model consists of a shallow feature extraction module in the SwinIR model, a first residual module, a semi-supervised shallow bridge module, a second residual module, a deep feature extraction module in the SwinIR model, a high-quality image reconstruction module in the SwinIR model, and an upsampling unit.

[0054] e) The i-th preprocessed original ocean noise image A in the training set i ′ is input into the shallow feature extraction module and residual module of the ocean image denoising network model, and the feature map A is output Q1 , residual image A′ Q1-1-R And the residual image A′ Q1-1-R The labeled image latent space M L .

[0055] f) The residual image A′ Q1-1-R Input into the semi-supervised shallow bridge module and the second residual module of the ocean image denoising network model, and output the unlabeled residual image A′ Q3-R-M And the unlabeled residual image A′ Q3-R-M The labeled image latent space M UL .

[0056] g) The unlabeled residual image A′ Q3-R-M Input into the deep feature extraction module of the ocean image denoising network model, and output the feature map A Q4 .

[0057] h) The feature map A Q4 Input to the high-quality image reconstruction module of the ocean image denoising network model, and output the feature map A Q4-R .

[0058] i) The feature map A Q4-R Input into the upsampling unit of the ocean image denoising network model, and output the denoised image A des .

[0059] j) Calculate the total loss function L, train the ocean image denoising network model according to the total loss function, and obtain the optimized ocean image denoising network model.

[0060] k) Take the i-th preprocessed original ocean noise image A in the test set i ′ is input into the optimized ocean image denoising network model, and the denoised image A is output d ' es .

[0061] First, the ocean noise image is input into a deep feature extraction module composed of several residual Transformer blocks to obtain a feature map, and the obtained feature map is input into the SwinIR network improved by the input mask operation and the attention mask. The input mask randomly masks the feature markers embedded in the first convolutional layer, and the network is allowed to complete the masking information during training, so that the network can recognize and reconstruct the image content from very limited information to obtain a randomly occluded ocean image; the obtained randomly occluded ocean image is sent to the latent bridge network, and the latent space corresponding to the noise image and the denoised image is subtracted to obtain the latent space related to the noise, so that the difference between the labeled and unlabeled noise data is minimized, and the loss is minimized to achieve domain adaptation; the obtained image is trained with an attention mask, so that the mask training network can work on the unmasked input image, and finally, after the training is completed, a noise-free image is obtained. The present invention introduces mask training and latent bridge networks, and uses a soft threshold function instead of a sigmoid function to effectively remove noise from real ocean images. At the same time, the method can eliminate severe noise damage and retain image details, thereby producing clearer edges and more natural textures.

[0062] In order to verify the reliability of this patented method, the final denoising results are systematically evaluated and compared using different methods, with PSNR, SSIM and LPIPS as evaluation criteria, as shown in Table 1:

[0063] Table 1 Comparison of different experimental methods

[0064]

[0065] It can be seen from Table 1 that the experimental method compares a variety of classic image denoising methods, namely DnCNN, RIDNet, RNAN, RDN, and SwinIR. The evaluation index adopts the four most commonly used evaluation indicators of image denoising methods, namely PSNR, SSIM, and LPIPS. The higher the PSNR value, the better the image quality. The value range of SSIM is [-1, 1], 1 means that the two images are exactly the same. The closer the SSIM value is to 1, the better the image quality. The lower the LPIPS value, the better the image quality. It can be seen from the data in the table that the PSNR evaluation index of the method of the present invention is improved by 0.38% compared with the previous optimal method, the SSIM evaluation index is improved by 0.95% compared with the previous optimal method, and the LPIPS evaluation index is reduced by 1.01% compared with the previous optimal method, which are all better than the previous methods. It shows that the method of the present invention has certain advantages, and the image denoising effect is relatively ideal, especially in that the improvement of LPIPS in accordance with the subjective perception of the human eye is more significant.

[0066] In one embodiment of the present invention, in step a), n original ocean noise images are obtained from the WSODD dataset to obtain an original image set A0. The publicly available WSODD dataset includes 14 common object categories and 21,911 instances, and provides 7,467 ocean noise images under different water environments, climate conditions, and shooting times.

[0067] In one embodiment of the present invention, step b) comprises the following steps:

[0068] b-1) Take the i-th original ocean noise image A i Crop to 128×128 pixels.

[0069] b-2) The cropped image is randomly rotated 90° and then randomly rotated 180° to obtain the i-th preprocessed original ocean noise image A′ i . Enhance the image by flipping it vertically and horizontally.

[0070] In one embodiment of the present invention, in step c), the preprocessed ocean image set A′0 is divided into a training set and a test set in a ratio of 3:1.

[0071] In one embodiment of the present invention, step e) comprises the following steps:

[0072] e-1) Take the i-th preprocessed original ocean noise image A′ in the training set i Input into the shallow feature extraction module of the ocean image denoising network model, and output the feature map A Q1 .

[0073] e-2) The feature map AQ1 Input it into the residual module of the ocean image denoising network model, and use the getrandbits function in Python's random library to perform random sampling on the feature map A. Q1 Perform a random mask operation to obtain the masked labeled noise image A Q1-1 .

[0074] e-3) Use the fastN1MeansDenoising function in Python's OpenCV library to denoise the image and obtain the labeled denoised image A Q1-1-R .

[0075] e-4) The masked labeled noise image A Q1-1 With the labeled denoised image A Q1-1-R Perform a subtraction operation to obtain the residual image A′ Q1-1-R .

[0076] e-5) Use the absdiff function in Python's OpenCV library to calculate the residual image A′ Q1-1-R Extract the residual and get the labeled image latent space M L .

[0077] In one embodiment of the present invention, step f) comprises the following steps:

[0078] f-1) The semi-supervised shallow bridge module of the ocean image denoising network model consists of the first two-dimensional convolutional layer, the second two-dimensional convolutional layer, the third two-dimensional convolutional layer, the maximum pooling layer, and the fully connected layer.

[0079] f-2) The feature map A Q1 Input into the first two-dimensional convolutional layer of the semi-supervised shallow bridge module, and output the feature map A′ Q ″ 1-1-R .

[0080] f-3) The feature map A′ Q ″ 1-1-R Input into the second 2D convolutional layer of the semi-supervised shallow bridge module, and output the feature map A Q2 .

[0081] f-4) The feature map A Q2 Input into the third 2D convolutional layer of the semi-supervised shallow bridge module, and output the feature map A′ Q2-1-R .

[0082] f-5) The feature map A′ Q2-1-R Input into the maximum pooling layer of the semi-supervised shallow bridge module, and output the feature map A Q3 , f-6) The feature map A Q3Input into the fully connected layer of the semi-supervised shallow bridge module, and output the feature map A″ Q1-1-R .

[0083] f-7) The feature map A″ Q1-1-R The image is input into the second residual module of the ocean image denoising network model, and the flip function in the Python OpenCV library is used to perform a horizontal flip image enhancement operation with the coordinate axis 1 to obtain the feature map.

[0084] f-8) Use the add function in Python's OpenCV library to add the residual image A' Q1-1-R With feature map Perform the addition operation to obtain the feature map A Q3-R-M .

[0085] f-9) For feature map A Q3-R-M Use the flip function in Python's OpenCV library to perform a vertical flip image enhancement operation with the coordinate axis at 0 to obtain the feature map

[0086] f-10) The feature map A Q3-R-M With the characteristic graph A″ Q1-1-R Perform a subtraction operation to obtain the unlabeled residual image A′ Q3-R-M .

[0087] f-11) Use the absdiff function in Python's OpenCV library to analyze the unlabeled residual image A′ Q3-R-M Extract the residual and get the unlabeled residual image A′ Q3-R-M The labeled image latent space M UL .

[0088] In this embodiment, preferably, in step f-2), the convolution kernel size of the first two-dimensional convolution layer is 3×3, the padding is 1, and the step size is 1; in step f-3), the convolution kernel size of the second two-dimensional convolution layer is 3×3, the padding is 1, and the step size is 1; in step f-4), the convolution kernel size of the third two-dimensional convolution layer is 3×3, the padding is 1, and the step size is 1; in step f-5), the pooling kernel size of the maximum pooling layer is 2×2, and the step size is 2; in step f-6), the pooling kernel size of the fully connected layer is 2×2, and the step size is 4.

[0089] In one embodiment of the present invention, in step i), the feature map A Q4-R Input to the upsampling unit of the ocean image denoising network model, and use the PixelShuffle function in Pytorch to shuffle the feature map A Q4-R Perform upsampling to obtain the denoised image A des .

[0090] In one embodiment of the present invention, step j) comprises the following steps:

[0091] j-1) The feature map A Q4 Input into the encoder module of the Transformer network model and output the H*W feature matrix G.

[0092] j-2) By the formula L=L L1 +λ1L const +λ2L potential The total loss function L is calculated, where L L1 is the regularized loss function, It is a concatenation operation, and λ1 and λ2 are both weights.

[0093] j-3) Use the Adam optimizer and the total loss function L to train the ocean image denoising network model to obtain the optimized ocean image denoising network model.

[0094] In this embodiment, preferably, the number of iterations when training the ocean image denoising network model is 200K, the learning rate is set to 0.0002, the learning speed is set to decay 0.8 times every 20 iterations, and the initial learning rate is set to 1×10 -4 , the batch size is set to 64, λ1=0.1, λ2=0.1.

[0095] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for denoising ocean images based on SwinIR, characterized in that: The steps include: a) Obtain n original ocean noise images, and obtain the original ocean image set A0, A0 = {A1, A2, ..., A i ,...,A n }, A i is the i-th original ocean noise image, i∈{1,...,n}, A i ∈R H×W×C , R is the real number space, W is the width of the i-th original ocean noise image, and H is the height of the i-th original ocean noise image; b) Take the i-th original ocean noise image A i Preprocessing is performed to obtain the i-th preprocessed original ocean noise image A′ i , the preprocessed ocean image set is A′0, A′0={A′1,A′2,...,A′ i ,...,A′ n }; c) dividing the preprocessed ocean image set A′0 into a training set and a test set; d) Establishing an ocean image denoising network model, which consists of a shallow feature extraction module in the SwinIR model, a first residual module, a semi-supervised shallow bridge module, a second residual module, a deep feature extraction module in the SwinIR model, a high-quality image reconstruction module in the SwinIR model, and an upsampling unit; e) Take the i-th preprocessed original ocean noise image A′ in the training set i Input into the shallow feature extraction module and residual module of the ocean image denoising network model, and output the feature map A Q1 , residual image A′ Q1-1-R And the residual image A′ Q1-1-R The labeled image latent space M L ; f) The residual image A′ Q1-1-R Input into the semi-supervised shallow bridge module and the second residual module of the ocean image denoising network model, and output the unlabeled residual image A′ Q3-R-M And the unlabeled residual image A′ Q3-R-M The labeled image latent space M UL ; g) The unlabeled residual image A′ Q3-R-M Input into the deep feature extraction module of the ocean image denoising network model, and output the feature map A Q4 ; h) The feature map A Q4 Input to the high-quality image reconstruction module of the ocean image denoising network model, and output the feature map A Q4-R ; i) The feature map A Q4-R Input into the upsampling unit of the ocean image denoising network model, and output the denoised image A des ; j) calculating the total loss function L, training the ocean image denoising network model according to the total loss function, and obtaining an optimized ocean image denoising network model; k) Take the i-th preprocessed original ocean noise image A′ in the test set i Input into the optimized ocean image denoising network model, and output the denoised image A′ des ; Step e) comprises the following steps: e-1) Take the i-th preprocessed original ocean noise image A′ in the training set i Input into the shallow feature extraction module of the ocean image denoising network model, and output the feature map A Q1 ; e-2) The feature map A Q1 Input it into the residual module of the ocean image denoising network model, and use the getrandbits function in Python's random library to perform random sampling on the feature map A. Q1 Perform a random mask operation to obtain the masked labeled noise image A Q1-1 ; e-3) Use the fastN1MeansDenoising function in Python's OpenCV library to denoise the image and obtain the labeled denoised image A Q1-1-R ; e-4) The masked labeled noise image A Q1-1 With the labeled denoised image A Q1-1-R Perform a subtraction operation to obtain the residual image A′ Q1-1-R ; e-5) Use the absdiff function in Python's OpenCV library to calculate the residual image A′ Q1-1-R Extract the residual and get the labeled image latent space M L ; Step f) comprises the following steps: f-1) The semi-supervised shallow bridge module of the ocean image denoising network model consists of the first two-dimensional convolutional layer, the second two-dimensional convolutional layer, the third two-dimensional convolutional layer, the maximum pooling layer, and the fully connected layer; f-2) The feature map A Q1 Input into the first two-dimensional convolutional layer of the semi-supervised shallow bridge module, and output the feature map A″′ Q1-1-R ; f-3) The feature map A″′ Q1-1-R Input into the second 2D convolutional layer of the semi-supervised shallow bridge module, and output the feature map A Q2 ; f-4) The feature map A Q2 Input into the third 2D convolutional layer of the semi-supervised shallow bridge module, and output the feature map A′ Q2-1-R ; f-5) The feature map A′ Q2-1-R Input into the maximum pooling layer of the semi-supervised shallow bridge module, and output the feature map A Q3 , f-6) The feature map A Q3 Input into the fully connected layer of the semi-supervised shallow bridge module, and output the feature map A″ Q1-1-R ; f-7) The feature map A″ Q1-1-R The image is input into the second residual module of the ocean image denoising network model, and the flip function in the Python OpenCV library is used to perform a horizontal flip image enhancement operation with the coordinate axis 1 to obtain the feature map. f-8) Use the add function in Python's OpenCV library to add the residual image A' Q1-1-R With feature map Perform the addition operation to obtain the feature map A Q3-R-M ; f-9) For feature map A Q3-R-M Use the flip function in Python's OpenCV library to perform a vertical flip image enhancement operation with the coordinate axis at 0 to obtain the feature map f-10) The feature map A Q3-R-M With the characteristic graph A″ Q1-1-R Perform a subtraction operation to obtain the unlabeled residual image A′ Q3-R-M ; f-11) Use the absdiff function in Python's OpenCV library to analyze the unlabeled residual image A′ Q3-R-M Extract the residual and get the unlabeled residual image A′ Q3-R-M The labeled image latent space M UL .

2. The ocean image denoising method based on SwinIR according to claim 1, characterized in that: In step a), n original ocean noise images are obtained from the WSODD dataset to obtain an original image set A0.

3. The ocean image denoising method based on SwinIR according to claim 1, characterized in that: Step b) comprises the following steps: b-1) Take the i-th original ocean noise image A i Crop to 128×128 pixels; b-2) The cropped image is randomly rotated 90° and then randomly rotated 180° to obtain the i-th preprocessed original ocean noise image A′ i .

4. The ocean image denoising method based on SwinIR according to claim 1, characterized in that: In step c), the preprocessed ocean image set A′0 is divided into a training set and a test set in a ratio of 3:

1.

5. The ocean image denoising method based on SwinIR according to claim 1, characterized in that: In step f-2), the convolution kernel size of the first two-dimensional convolution layer is 3×3, padding is 1, and the step size is 1; in step f-3), the convolution kernel size of the second two-dimensional convolution layer is 3×3, padding is 1, and the step size is 1; in step f-4), the convolution kernel size of the third two-dimensional convolution layer is 3×3, padding is 1, and the step size is 1; in step f-5), the pooling kernel size of the maximum pooling layer is 2×2, and the step size is 2; in step f-6), the pooling kernel size of the fully connected layer is 2×2, and the step size is 4.

6. The ocean image denoising method based on SwinIR according to claim 1, characterized in that: In step i), the feature map A Q4-R Input to the upsampling unit of the ocean image denoising network model, and use the PixelShuffle function in Pytorch to shuffle the feature map A Q4-R Perform upsampling to obtain the denoised image A des .

7. The ocean image denoising method based on SwinIR according to claim 1, characterized in that: Step j) comprises the following steps: j-1) The feature map A Q4 Input into the encoder module of the Transformer network model, and output the feature matrix G of H*W; j-2) By the formula L=L L1 +λ1L const +λ2L potential The total loss function L is calculated, where L L1 is the regularized loss function, It is a concatenation operation, λ1 and λ2 are weights; j-3) Use the Adam optimizer and the total loss function L to train the ocean image denoising network model to obtain the optimized ocean image denoising network model.

8. The ocean image denoising method based on SwinIR according to claim 7, characterized in that: When training the ocean image denoising network model, the number of iterations is 200K, the learning rate is set to 0.0002, the learning speed is set to decay 0.8 times every 20 iterations, and the initial learning rate is set to 1×10 -4 , the batch size is set to 64, λ1=0.1, λ2=0.1.