Underwater image restoration method based on distortion guidance

By constructing an underwater multi-type distortion image database and training a distortion detection network, combining the Transformer and Encoder-Decoder structures, and using the DAM distortion aggregation module and Gibbs sampling, the problem of being unable to locate the distortion area in underwater image restoration is solved, significantly improving image restoration effect.

CN115049562BActive Publication Date: 2024-09-03FUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210782462.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-05
Publication Date
2024-09-03
Estimated Expiration
2042-07-05

AI Technical Summary

Technical Problem

Existing technologies cannot effectively locate and process the distortion areas and distortion types of underwater transmission images, resulting in poor image restoration results.

Method used

Using a method based on distortion guidance, by constructing an underwater multi-type distortion image database, training the distortion detection network, predicting the distortion mask map, and using the Transformer architecture and Encoder-Decoder structure for image restoration, combined with the DAM distortion aggregation module and Gibbs Sampling, pinpointing and processing areas of distortion.

Benefits of technology

It significantly improves the restoration effect of underwater distorted images, can more accurately locate and correct different types of distortion, and significantly improves the clarity of images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115049562B
    Figure CN115049562B
Patent Text Reader

Abstract

The present invention relates to a method for underwater image restoration based on distortion guidance, comprising: step S1: constructing an underwater multi-type distorted image database; step S2: training a distortion detection network through I and M in the underwater distorted image database, and predicting a mask map M' of a distorted image; step S3: downsampling the underwater distorted image and discretizing it to reduce the dimensional space size of the input image, setting the distorted pixels of the underwater distorted image to 0 according to the mask map M' of the underwater distorted image, and then inputting the Transformer architecture, performing Gibbs sampling on the output probability map, and obtaining a low-resolution prior image of the restored image; step S4: using an Encoder-Decoder structure as the main architecture of the restoration network, and constructing three branch inputs at the encoding end of the restoration network; step S5: constructing a DAM distortion aggregation module, and using the intermediate layer information of the distortion detection network to guide the restoration network, and finally obtaining a restored image of the underwater distorted image. The present invention can effectively improve the restoration effect of underwater distorted images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image restoration, and in particular to an underwater image restoration method based on distortion guidance. Background Art

[0002] Human beings are entering the information age. As an important carrier of information, images play an important role in daily life and work. As a carrier of marine information, underwater images are an important way for humans to explore marine information. Underwater images are widely used in marine energy exploration, underwater rescue, marine ecological protection, marine biological research and other fields. However, compared with wireless channels, due to the complex and changeable marine environment, underwater acoustic channels often have harsh conditions such as fast time variation, narrow bandwidth, and fast fading, which makes the distortion of underwater transmitted images much greater than that of images transmitted in wireless channels. Therefore, images transmitted through underwater acoustic channels often have serious distortion.

[0003] Existing strategies for improving underwater degraded image quality can be divided into two types: enhancement and restoration, depending on whether they are based on imaging models. The enhancement algorithm adds some information or transforms data to the original image by certain means, selectively highlights the features of interest in the image or suppresses (masks) some unnecessary features in the image, so that the image matches the visual response characteristics, and has nothing to do with the physical imaging process. In contrast, the restoration algorithm mathematically models the degradation process of underwater images, and inverts the degradation process by estimating model parameters to restore the degraded image and obtain a clear underwater image. However, existing algorithms cannot locate the distortion area and distortion type of underwater transmission distorted images, which has a great impact on the results of image restoration. Summary of the invention

[0004] In view of this, an object of the present invention is to provide an underwater image restoration method based on distortion guidance, which can effectively improve the restoration effect of underwater distorted images.

[0005] To achieve the above object, the present invention adopts the following technical solution:

[0006] A method for underwater image restoration based on distortion guidance comprises the following steps:

[0007] Step S1: Obtain the underwater original image GT, the underwater distorted image I, and the distortion mask image M representing the image distortion area and distortion type, and construct an underwater multi-type distorted image database;

[0008] Step S2: training a distortion detection network through I and M in the underwater distorted image database, and predicting a mask image M' of a distorted image;

[0009] S3: Downsample and discretize the underwater distorted image to reduce the dimensional space size of the input image. Set the distorted pixels of the underwater distorted image to 0 according to the mask map M' of the underwater distorted image and input it into the Transformer architecture. Perform Gibbs sampling on the output probability map to obtain a low-resolution prior image of the restored image.

[0010] S4: The Encoder-Decoder structure is used as the main architecture of the restoration network, and the input of three branches is constructed at the encoding end of the restoration network;

[0011] S5: Construct a DAM distortion aggregation module and use the intermediate layer information of the distortion detection network to guide the restoration network, and finally obtain the restored image of the underwater distorted image.

[0012] Furthermore, the step S1 is specifically as follows: the underwater original image GT is photographed in an underwater environment, and different distortion types are processed on the underwater original image to obtain distorted images and labels of different distortion types. In the process of processing the original image to obtain different types of distorted images, the distorted area and distortion type of the image are recorded at the same time, and a distortion detection label mask image M is generated.

[0013] Furthermore, the distortion types include underwater transmission distortion, ocean snow distortion, and motion blur distortion.

[0014] For underwater transmission distortion, it is obtained by building a simulated underwater acoustic communication system and transmitting the original image;

[0015] For the marine snow distortion, it is obtained by artificially adding marine snow distortion layers of different degrees to the original image;

[0016] For target motion blur distortion, a closed area is randomly selected in the original image and motion blurred.

[0017] Furthermore, the step S2 is specifically as follows:

[0018] Step S21: Based on the semantic segmentation algorithm, the distorted image is classified at the pixel level, the distorted area and distortion type are located, and U-net is used as the backbone of the distortion detection network;

[0019] Step S22: train the distortion detection network using I and M in the underwater multi-type distorted image database, and predict a mask image M' of the distorted image.

[0020] Furthermore, the step S3 is specifically as follows:

[0021] Step S31: down-sample the distorted image of m*m*3 to (m / 8)*(m / 8)*3 and discretize it;

[0022] Step S32: according to the distortion mask image M' obtained in S2, the distorted pixels corresponding to the discrete image of the downsampled image are set to 0, and after token embedding, they are input into the Transformer to obtain a probability map of a low-resolution restored image;

[0023] Step S33: perform Gibbs sampling on the probability map to obtain a low-resolution prior image of the restored image.

[0024] Furthermore, the specific process of the discretization processing is: using a clustering algorithm for the pixel points of the underwater image to obtain n central sample points, which represent the n most frequently appearing three-channel pixel values ​​in the underwater image; for each pixel point of the downsampled image of (m / 8)*(m / 8)*3, selecting the central sample point with the closest Euclidean distance to replace it, the dimensional space of the image is reduced from the original (m / 8)*(m / 8)*(256^3) to (m / 8)*(m / 8)*n.

[0025] Furthermore, the step S4 is specifically as follows:

[0026] Step S41: using the Encoder-Decoder structure as the main architecture of the restoration network;

[0027] Step S42: The encoding end of the recovery network constructs the input of three branches:

[0028] The input of branch 1 is the distortion mask map M' located by the distortion detection network;

[0029] The input of branch 2 is as follows:

[0030] I M =I⊙(1-M')

[0031] Where I is the distorted image, M' is the predicted distortion mask, and ⊙ is the matrix dot product.

[0032] The input of branch 3 is the low-resolution prior image of the restored image obtained in step S3.

[0033] Step S43: The three inputs are concat-operated in the channel dimension and input to the encoding end of the restoration network.

[0034] Furthermore, the step S5 is specifically as follows:

[0035] Step S51: extracting the intermediate layer information of the encoding end during the forward propagation of the distortion detection network, namely, three feature maps of different scales: C*H*W, (2C)*(H / 2)*(W / 2), and (4C)*(H / 4)*(W / 4);

[0036] Step S52: Construct the DAM distortion aggregation module and extract the three-layer feature map to perform feature fusion of different scales, and use the convolution layer and relu activation function to process step by step. The output of each level acts on the input of the next level, as follows:

[0037] f i '=DAM(concat[f i ,f i ' -1 ])

[0038] f i represents the feature map of the i-th layer of the encoding end of the distortion detection network L, f i ' is the corresponding output, whose dimension is the same as the input dimension;

[0039] Step S53: The three different scale outputs of the DAM distortion aggregation module are received at the decoding end of the restoration network, and the three layers of feature maps of the same dimension at the decoding end are concat-operated in the channel dimension. The information of different scales of the DAM output comes from the middle layer of the distortion detection network, which can distinguish whether the feature is distorted or not, and clarifies the direction of network restoration, thereby guiding the restoration network to accurately restore the distorted image.

[0040] Furthermore, the following loss function is set during the training of the restoration network R:

[0041]

[0042] I R is the restoration result predicted by the restoration network R, and GT is the underwater original image. loss

[0043]

[0044] Where D is the discriminator, which is used to form a game with the restoration network to calculate the generated adversarial loss, and the Nash equilibrium is achieved through training optimization. The final total loss function is as follows:

[0045]

[0046] Among them, α1 and α2 are preset values.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] The present invention can effectively improve the restoration effect of underwater distorted images. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is the overall framework diagram of the method of the present invention;

[0050] Figure 2is a distortion detection database in one embodiment of the present invention;

[0051] Figure 3 This is a flow chart of input branch c in one embodiment of the present invention;

[0052] Figure 4 This is the distorted image restoration result in one embodiment of the present invention. DETAILED DESCRIPTION

[0053] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0054] Please refer to Figure 1 The present invention provides an underwater image restoration method based on distortion guidance, comprising the following steps:

[0055] Step S1: Obtain the underwater original image GT, the underwater distorted image I, and the distortion mask image M representing the image distortion area and distortion type, and construct an underwater multi-type distorted image database, specifically:

[0056] Construct an underwater multi-type distorted image database, including the underwater original image GT, the underwater distorted image I, and the distortion mask M representing the image distortion area and distortion type. The underwater original image is taken in a real underwater environment. The underwater original image is processed with different distortion types to obtain different distorted images and labels, such as Figure 2 As shown; in the process of processing the original image to obtain different types of distorted images, the distorted area and distortion type of the image are recorded at the same time, and a distortion detection label mask image M is generated;

[0057] Preferably, in this embodiment, the distortion types selected are underwater transmission distortion, motion blur distortion, and ocean snow distortion; for underwater transmission distortion, it is obtained by building a simulated underwater acoustic communication system and transmitting the original image; for target motion blur distortion, a closed area is randomly selected in the original image and motion blur processing is performed, the purpose of which is to allow the distortion detection network to learn to identify blurred features; for ocean snow distortion, it is obtained by artificially adding ocean snow distortion layers of different degrees to the original image;

[0058] Step S2: training a distortion detection network through I and M in the underwater distorted image database, and predicting a mask image M' of a distorted image;

[0059] Preferably, in this embodiment, step S2 specifically includes the following steps:

[0060] S21. Apply the idea of ​​semantic segmentation to distortion detection, classify the distorted image at the pixel level, locate the distorted area and distortion type, and use U-net as the backbone of the distortion detection network;

[0061] S22, training a distortion detection network through I and M in the underwater distorted image database, thereby accurately predicting a mask image M' of a distorted image;

[0062] S3: Downsample and discretize the distorted image to reduce the dimensional space size of the input image. Set the distorted pixels of the image to 0 according to M' and input it into the Transformer architecture. Perform Gibbs sampling on the output probability map to obtain a low-resolution prior image of the restored image. The process of step S3 is as follows: Figure 3 As shown;

[0063] Preferably, in this embodiment, step S3 specifically comprises the following steps:

[0064] S31, downsampling the distorted image of 256*256*3 to 32*32*3, and then discretizing it to further reduce the input dimension space;

[0065] S32, the specific process of discretization is: use clustering algorithm for a large number of underwater image pixels to obtain 512 central sample points, which represent the 512 most frequently appearing three-channel pixel values ​​in the underwater image. For each pixel of the 32*32*3 downsampled image, select the central sample point with the closest Euclidean distance to replace it, so as to discretize the image and reduce the dimensional space. The dimensional space of the image will be changed from the original 32*32*(256^3) to 32*32*512;

[0066] S33, according to the distortion mask image M' obtained in S2, the distorted pixels corresponding to the discrete image of the downsampled image are set to 0, and after token embedding, they are input into the Transformer to obtain a probability map of the low-resolution restored image;

[0067] S34. Perform Gibbs sampling on the probability map to obtain a low-resolution prior image of the restored image.

[0068] S4: The Encoder-Decoder structure is used as the main architecture of the restoration network, and the input of three branches is constructed at the encoding end of the restoration network;

[0069] Preferably, in this embodiment, step S4 specifically comprises the following steps:

[0070] S41, using the Encoder-Decoder structure as the main architecture of the restoration network;

[0071] S42, such as Figure 1 As shown, the encoding end of the restoration network constructs the input of three branches: the input of branch (a) is the distortion mask map M' located by the distortion detection network; the input of branch (b) is as follows:

[0072] I M =I⊙(1-M')

[0073] I is the distorted image, M' is the predicted distortion mask, and ⊙ is the matrix dot product.

[0074] The input of branch (c) is the low-resolution prior image of the restored image obtained in step S3.

[0075] S43. The three inputs are concat-operated in the channel dimension and input into the encoding end of the restoration network.

[0076] S5: Construct a DAM distortion aggregation module and use the intermediate layer information of the distortion detection network to guide the restoration network, and finally obtain the restored image of the underwater distorted image.

[0077] Preferably, in this embodiment, step S5 specifically comprises the following steps:

[0078] S51, extracting the intermediate layer information of the encoding end during the forward propagation of the distortion detection network, which are feature maps of three different scales: 64*256*256, 128*128*128, and 256*64*64;

[0079] S52. Design and use the DAM distortion aggregation module to perform feature fusion of different scales on the extracted three-layer feature maps, and use the convolution layer and relu activation function to process them step by step. The output of each level acts on the input of the next level, as follows:

[0080] f i '=DAM(concat[f i ,f i ' -1 ])

[0081] f i represents the feature map of the i-th layer of the encoding end of the distortion detection network L, f i ' is the corresponding output, whose dimension is the same as the input dimension;

[0082] S53, receiving the three different scale outputs of the DAM distortion aggregation module at the decoding end of the restoration network, and performing a concat operation on the channel dimension with the three-layer feature map of the same dimension at the decoding end. The information of different scales of the DAM output comes from the middle layer of the distortion detection network, which can distinguish whether the feature is distorted or not, and clarifies the direction of network restoration, thereby guiding the restoration network to accurately restore the distorted image. The distorted image restoration result is as follows: Figure 4 ;

[0083] S54. Set the following loss function during training the restoration network R:

[0084]

[0085] I R is the restoration result predicted by the restoration network R, and GT is the underwater original image. loss

[0086]

[0087] Where D is the discriminator, and the idea of ​​GAN is used to calculate the generation adversarial loss. The final total loss function is as follows:

[0088]

[0089] After experiments, α1=1.2, α2=0.1 are set.

[0090] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.

Claims

1. A method for underwater image restoration based on distortion guidance, characterized in that: The following steps are involved: Step S1: Obtain the underwater original image GT, the underwater distorted image I, and the distortion mask image M representing the image distortion area and distortion type, and construct an underwater multi-type distorted image database; Step S2: training a distortion detection network through I and M in the underwater distorted image database, and predicting a mask image M' of a distorted image; Step S3: downsample and discretize the underwater distorted image to reduce the dimensional space size of the input image, set the distorted pixels of the underwater distorted image to 0 according to the mask map M' of the underwater distorted image, and then input it into the Transformer architecture, perform Gibbs sampling on the output probability map, and obtain a low-resolution prior image of the restored image; Step S4: adopt the Encoder-Decoder structure as the main architecture of the restoration network, and construct the input of three branches at the encoding end of the restoration network; Step S5: construct a DAM distortion aggregation module, and use the intermediate layer information of the distortion detection network to guide the restoration network, and finally obtain a restored image of the underwater distorted image; The step S4 is specifically as follows: Step S41: using the Encoder-Decoder structure as the main architecture of the restoration network; Step S42: The encoding end of the recovery network constructs the input of three branches: The input of branch 1 is the distortion mask map M' located by the distortion detection network; The input of branch 2 is as follows: I M =I⊙(1-M') Where I is the distorted image, M' is the predicted distortion mask, and ⊙ is the matrix dot product; The input of branch 3 is the low-resolution prior image of the restored image obtained in step S3; Step S43: The three inputs are concat-operated in the channel dimension and input to the encoding end of the restoration network; The step S5 is specifically as follows: Step S51: extracting the intermediate layer information of the encoding end during the forward propagation of the distortion detection network, namely, three feature maps of different scales: C*H*W, (2C)*(H / 2)*(W / 2), and (4C)*(H / 4)*(W / 4); Step S52: Construct a DAM distortion aggregation module and perform feature fusion of different scales on the extracted three-layer feature maps, and use convolutional layers and relu activation functions to process them step by step. The output of each level acts on the input of the next level, as follows: f i '=DAM(concat[f i ,f i ' -1 ]) f i represents the feature map of the i-th layer of the encoding end of the distortion detection network L, f i ' is the corresponding output, whose dimension is the same as the input dimension; Step S53: The three different scale outputs of the DAM distortion aggregation module are received at the decoding end of the restoration network, and the three-layer feature map of the same dimension at the decoding end is concat-operated in the channel dimension; the information of different scales of the DAM output comes from the middle layer of the distortion detection network, which can distinguish whether the feature is distorted or not, and clarifies the direction of network restoration, thereby guiding the restoration network to accurately restore the distorted image; The following loss function is set during the training of the restoration network R: I R is the restoration result predicted by the restoration network R, and GT is the underwater original image. loss Where D is the discriminator, which is used to form a game with the restoration network to calculate the generated adversarial loss, and the Nash equilibrium is achieved through training optimization. The final total loss function is as follows: Among them, α1 and α2 are preset values.

2. The underwater image restoration method based on distortion guidance according to claim 1, characterized in that: The step S1 is specifically as follows: the underwater original image GT is photographed in an underwater environment, and different distortion types are processed on the underwater original image to obtain distorted images and labels of different distortion types. In the process of processing the original image to obtain different types of distorted images, the distorted area and distortion type of the image are recorded at the same time, and a distortion detection label mask image M is generated.

3. The method for underwater image restoration based on distortion guidance according to claim 2, characterized in that: The distortion types include underwater transmission distortion, ocean snow distortion, motion blur distortion, For underwater transmission distortion, it is obtained by building a simulated underwater acoustic communication system and transmitting the original image; For the marine snow distortion, it is obtained by artificially adding marine snow distortion layers of different degrees to the original image; For target motion blur distortion, a closed area is randomly selected in the original image and motion blurred.

4. The underwater image restoration method based on distortion guidance according to claim 1, characterized in that: The step S2 is specifically as follows: Step S21: Based on the semantic segmentation algorithm, the distorted image is classified at the pixel level, the distorted area and distortion type are located, and U-net is used as the backbone of the distortion detection network; Step S22: train the distortion detection network using I and M in the underwater multi-type distorted image database, and predict a mask image M' of the distorted image.

5. The method for underwater image restoration based on distortion guidance according to claim 1, characterized in that: The step S3 is specifically as follows: Step S31: down-sample the distorted image of m*m*3 to (m / 8)*(m / 8)*3 and discretize it; Step S32: according to the distortion mask image M' obtained in S2, the distorted pixels corresponding to the discrete image of the downsampled image are set to 0, and after token embedding, they are input into the Transformer to obtain a probability map of a low-resolution restored image; Step S33: perform Gibbs sampling on the probability map to obtain a low-resolution prior image of the restored image.

6. The method for underwater image restoration based on distortion guidance according to claim 5, characterized in that: Said The specific process of discretization is as follows: a clustering algorithm is used for the pixels of the underwater image to obtain n central sample points, which represent the n most frequently appearing pixel values ​​of the three channels in the underwater image; for each pixel of the downsampled image of (m / 8)*(m / 8)*3, the central sample point with the closest Euclidean distance is selected to replace it, and the dimensional space of the image is reduced from the original (m / 8)*(m / 8)*(256^3) to (m / 8)*(m / 8)*n.