An underwater image enhancement method, system and readable storage medium

By using a network framework trained through contrastive learning to process underwater images, and leveraging attention mechanisms and deformable convolutional layers to enhance image feature processing capabilities, combined with Gaussian sampling layers to generate clear images, the problem of color shift and detail blurring in underwater images is solved, achieving high-quality underwater image restoration.

CN115564676BActive Publication Date: 2025-12-05EAST CHINA UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211208720.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2025-12-05
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

Underwater images suffer from color shifts and blurred details due to water absorption and scattering. Traditional methods are inadequate to restore clear and high-quality underwater images.

Method used

A contrastive learning-based network framework is adopted, which processes underwater image features through attention mechanism module, context module and deformable convolutional layer, and generates clear images by combining Gaussian sampling layer. The loss function includes clear image reconstruction loss, contrast regularization loss and dark channel prior loss.

Benefits of technology

It effectively enhances the underwater image, eliminates color deviation and blurring of image details, and restores clear and high-quality underwater images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115564676B_ABST
    Figure CN115564676B_ABST
Patent Text Reader

Abstract

The application provides an underwater image enhancement method, system and readable storage medium, and relates to the technical field of image processing. The underwater image enhancement method comprises the following steps: inputting an underwater image to be enhanced into a network framework, wherein the network framework is obtained based on contrast learning training; performing feature extraction on the underwater image to obtain image features; sequentially processing the image features through an attention mechanism module, a context module and a variable convolution; decoding the processed image features to obtain a preliminary enhanced image; obtaining a high-frequency image according to the preliminary enhanced image, and outputting a clear image according to the high-frequency image and the preliminary enhanced image. The network framework is trained by using contrast learning, which helps to improve the representation ability of the network. Meanwhile, the process of generating a clear image corresponding to the underwater image to be enhanced by the network framework is set, which can effectively improve the enhancement effect of the degraded underwater image.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to an underwater image enhancement method and system and a readable storage medium. BACKGROUND

[0002] The ocean is the origin of human life and contains extremely rich resources, which are precious wealth supporting the development of mankind. With the explosive growth of population and the rapid development of society, the resources on land are gradually exhausted, and it has been a consensus of various countries to develop and utilize marine resources reasonably. Building a marine power is not only of great significance to the economic development of China, but also conducive to improving China's international status in the complex world situation.

[0003] With the continuous development of marine exploration technology, computer vision technology applied in underwater scenes is also rapidly progressing. Compared with sonar imaging technology, underwater optical imaging technology not only has better accuracy and collection efficiency, but also has easy-to-carry equipment and lower cost, so underwater optical imaging technology has a wide range of applications.

[0004] However, due to the complexity of the marine environment and the inherent characteristics of underwater optical imaging, the images taken in the underwater environment often have color deviation, reduced contrast, and blurred details. The main reason for the degradation of underwater image quality is the absorption and scattering of underwater particles to the light incident into the water. On the one hand, due to the different absorption of water to light of different wavelengths, the longer the wavelength of light, the more obvious the absorption of water to the light of that wavelength. In natural light, since the wavelength of red light is the longest, the red light will disappear at a depth of about 5 meters underwater, which results in the image taken underwater being mostly blue-green, causing color deviation of the image. On the other hand, due to the scattering of the particles in the water to the light, the details of the image are blurred, the contrast is reduced, and a fog-like visual effect is produced.

[0005] Therefore, the enhancement and restoration of underwater images are of great significance to marine exploration, but the traditional underwater image enhancement effect needs to be enhanced. SUMMARY

[0006] The purposes of the present application include providing an underwater image enhancement method that can improve the enhancement effect of underwater images, ultimately eliminate the effects of color deviation, image detail blur, and other underwater effects, and achieve the restoration of clear and high-quality underwater images.

[0007] The purposes of the present application also include providing an underwater image enhancement system that can improve the enhancement effect of underwater images, ultimately eliminate the effects of color deviation, image detail blur, and other underwater effects, and achieve the restoration of clear and high-quality underwater images.

[0008] The purpose of the present application also includes. A readable storage medium is provided, which can improve the enhancement effect of underwater images, finally eliminate the influence of color deviation, image detail blur and other effects brought by underwater, and restore clear and high-quality underwater images.

[0009] Embodiments of the present application can be implemented in the following way:

[0010] An underwater image enhancement method comprises: inputting an underwater image to be enhanced into a network framework, wherein the network framework is obtained based on contrast learning training;

[0011] Feature extraction is performed on the underwater image to obtain image features;

[0012] The image features are processed in sequence through an attention mechanism module, a context module and a deformable convolution layer;

[0013] The processed image features are decoded to obtain a preliminary enhanced image;

[0014] A high-frequency image is obtained according to the preliminary enhanced image;

[0015] The clear image is output according to the high-frequency image and the preliminary enhanced image.

[0016] Optionally, the attention mechanism module comprises a channel attention mechanism module and a pixel attention mechanism module, and the channel attention mechanism module and the pixel attention mechanism module are connected in series to process the image features.

[0017] Optionally, the context module comprises an input convolution layer, an output convolution layer and a plurality of hollow convolution layers, and the step of processing the image features by the context module comprises:

[0018] The features output by the attention mechanism module are obtained through the input convolution layer, and the plurality of hollow convolution layers are connected in parallel;

[0019] The input features are processed through the plurality of hollow convolution layers;

[0020] The results of the parallel operation of the plurality of hollow convolution layers are obtained through the output convolution layer.

[0021] Optionally, the step of obtaining a high-frequency image according to the preliminary enhanced image comprises:

[0022] The preliminary enhanced image is processed by a Gaussian sampling layer to obtain a low-frequency image;

[0023] The high-frequency image is obtained from the preliminary enhanced image and the low-frequency image;

[0024] The step of outputting the clear image according to the high-frequency image and the preliminary enhanced image comprises:

[0025] combining the preliminary enhanced image with the high-frequency image to obtain the clear image.

[0026] Optionally, the underwater image enhancement method further comprises a training step of the network framework, the training step comprising:

[0027] constructing a training data set and pre-processing, the data set comprising a plurality of data pairs, each data pair comprising a degraded image and a corresponding clear image;

[0028] training the network framework using contrastive learning using the data set.

[0029] Optionally, the loss function of the network framework comprises a clear image reconstruction loss L rec , a contrastive regularization loss L CR and a dark channel prior loss L dark , and the formula of the overall loss function is as follows:

[0030] L total =λ rec ·L rec +λ CR ·λ CR +λ dark ·L dark ;

[0031] wherein λ rec =1, λ CR =0.1, λ dark =1e -5 .

[0032] An underwater image enhancement system comprising a network framework, the network framework being obtained based on contrastive learning training;

[0033] The network framework comprises:

[0034] an encoder for feature extraction of the underwater image to obtain image features;

[0035] a sequentially arranged attention mechanism module, a context module and a deformable convolution layer, the attention mechanism module, the context module and the deformable convolution layer being used for sequentially processing the image features;

[0036] a decoder for decoding the processed image features to obtain a preliminary enhanced image;

[0037] The processing module is configured to obtain a high-frequency image according to the preliminary enhanced image, and output the clear image according to the high-frequency image and the preliminary enhanced image.

[0038] Optionally, the encoder comprises three down-sampling layers, and the decoder comprises three up-sampling layers.

[0039] Optionally, the context module comprises an input convolution layer, an output convolution layer, and four hollow convolution layers, the input convolution layer is configured to connect the output of the attention mechanism module and the four hollow convolution layers, the four hollow convolution layers are configured to process the input features, and the output convolution layer is configured to obtain the results of the parallel operation of the four hollow convolution layers.

[0040] The hollow rates of the four hollow convolution layers are 1, 2, 3 and 4, respectively.

[0041] A readable storage medium, the readable storage medium stores a computer program, the computer program is executed by a processor to realize the underwater image enhancement method.

[0042] The underwater image enhancement method, system and readable storage medium provided by the embodiments of the present application have the following beneficial effects:

[0043] The embodiments of the present application provide an underwater image enhancement method, which comprises inputting an underwater image to be enhanced into a network framework, the network framework being obtained based on contrast learning training; performing feature extraction on the underwater image to obtain image features; sequentially processing the image features through an attention mechanism module, a context module and a variable convolution; decoding the processed image features to obtain a preliminary enhanced image; obtaining a high-frequency image according to the preliminary enhanced image, and outputting a clear image according to the high-frequency image and the preliminary enhanced image. By training the network framework through contrast learning, the representation ability of the network is improved. By setting the process of generating a clear image corresponding to the underwater image to be enhanced by the network framework, the enhancement effect of the degraded underwater image is effectively improved, the influence of color deviation, image detail blur and the like on the underwater image is eliminated, and the purpose of restoring a clear and high-quality underwater image is achieved.

[0044] The embodiment of the present application also provides an underwater image enhancement system, which comprises a network framework obtained based on contrast learning training, the network framework comprising an encoder, the encoder being used for feature extraction on the underwater image to obtain image features; an attention mechanism module, a context module and a deformable convolution layer arranged in sequence, the attention mechanism module, the context module and the deformable convolution layer being used for sequentially processing the image features; a decoder, the decoder being used for decoding the processed image features to obtain a preliminary enhanced image; and a processing module, the processing module being used for obtaining a high-frequency image according to the preliminary enhanced image and outputting the clear image according to the high-frequency image and the preliminary enhanced image. By using contrast learning to train the network framework, the representation ability of the network is improved, and by setting the process of generating the clear image corresponding to the underwater image to be enhanced by the network framework, the enhancement effect of the degraded underwater image is effectively improved, and finally the influence of color deviation, image detail blur and the like on the underwater image is eliminated, so that the clear and high-quality underwater image is recovered.

[0045] The embodiment of the present application also provides a readable storage medium, which stores a computer program executed by a processor to implement the underwater image enhancement method, so that the readable storage medium also has the beneficial effect of effectively improving the enhancement effect of the degraded underwater image, finally eliminating the influence of color deviation, image detail blur and the like on the underwater image, and recovering the clear and high-quality underwater image. BRIEF DESCRIPTION OF DRAWINGS

[0046] The above features and advantages of the present application can be better understood by reading the following detailed description of embodiments of the present application in conjunction with the drawings, in which the components are not necessarily drawn to scale and components of similar or identical function or structure can have the same or similar reference numbers.

[0047] Figure 1 A step diagram of an underwater image enhancement method according to an aspect of the present application is shown;

[0048] Figure 2 A network framework result diagram of an underwater image enhancement system according to an aspect of the present application is shown;

[0049] Figure 3 A schematic diagram of an attention mechanism module in a network framework according to an aspect of the present application is shown;

[0050] Figure 4 A schematic diagram of a context module in a network framework according to an aspect of the present application is shown;

[0051] Figure 5A qualitative experimental result comparison chart of the underwater image enhancement method provided by an aspect of the present application on one of the underwater images in the dataset UIEBD is shown.

[0052] Figure 6 A qualitative experimental result comparison chart of the underwater image enhancement method provided by an aspect of the present application on another underwater image in the dataset UIEBD is shown.

[0053] Reference signs:

[0054] 11-encoder; 12-attention mechanism module; 121-average pooling layer; 122-first convolutional layer; 123-first RELU layer; 124-second convolutional layer; 125-third convolutional layer; 126-second RELU layer; 127-fourth convolutional layer; 13-context module; 131-input convolutional layer; 132-dilated convolutional layer; 133-output convolutional layer; 14-deformable convolutional layer; 15-Gaussian sampling layer; 16-decoder. DETAILED DESCRIPTION

[0055] The present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. Note that the aspects described below in conjunction with the accompanying drawings and specific embodiments are only exemplary and should not be understood as limiting the scope of protection of the present application in any way.

[0056] Figure 1 A step chart of the underwater image enhancement method provided by the present embodiment is shown, Figure 2 A structure schematic diagram of the network framework provided by the present embodiment is shown. Please refer to Figure 1 and Figure 2 The present embodiment provides an underwater image enhancement method, and also provides an underwater image enhancement system having a network framework obtained based on contrast learning training, and the underwater image enhancement method can be implemented based on the network framework. Specifically, the underwater image enhancement method comprises:

[0057] S01: inputting an underwater image to be enhanced into the network framework.

[0058] The underwater image to be enhanced has quality degradation, for example, color shift, contrast reduction, detail blur, etc.

[0059] S02: performing feature extraction on the underwater image to obtain image features.

[0060] The network framework comprises an encoder 11, which processes the input underwater image by encoding to obtain image features. Specifically, in this embodiment, the encoder 11 comprises three convolutional layers, which are down-sampling layers. After the underwater image passes through the three down-sampling layers, the resolution of the underwater image is reduced to 1 / 4 of the original, and the image features are the image obtained after the three down-sampling layers. Optionally, in the three down-sampling layers, the convolutional kernel of the first layer is 7*7, and the step length of the convolutional kernel is 1; the convolutional kernel of the second layer and the third layer is 3*3, and the step length is 2.

[0061] S03: sequentially processing the image features through the attention mechanism module 12, the context module 13 and the deformable convolutional layer 14.

[0062] The network framework is provided with the attention mechanism module 12, the context module 13 and the deformable convolutional layer 14 after the decoder 16, and the image features are sequentially processed through the attention mechanism module 12, the context module 13 and the deformable convolutional layer 14, so that the extracted feature information is more rich and accurate. Specifically, the attention mechanism module 12 concentrates attention on the image degradation area; the context module 13 can improve the receptive field, so that the extracted image features contain more rich information; finally, the deformable convolutional layer 14 can further improve the accuracy of the extracted features.

[0063] Further, the network framework provided in this embodiment has six attention mechanism modules 12, which are sequentially connected and located between the encoder 11 and the context module 13. Meanwhile, the network framework has two deformable convolutional layers 14, which are located after the context module 13.

[0064] Figure 3 The schematic diagram of the attention mechanism module 12 in the network framework provided in this embodiment is shown in FIG. 2. Figures 1-3 In this embodiment, the attention mechanism module 12 is cascaded by a channel-level attention mechanism and a pixel-level attention mechanism. Hereinafter, the channel-level attention mechanism is referred to as a channel attention module, and the pixel-level attention mechanism is referred to as a pixel attention module. The output of the channel attention module is used as the input of the pixel attention module, and the two modules are cascaded and output through an activation function Sigmoid, thereby forming the attention mechanism module 12.

[0065] The channel attention module is composed of one average pooling layer 121, two convolution layers and one RELU layer. The RELU layer can effectively prevent the occurrence of gradient explosion. Specifically, in the channel attention module, the two convolution layers are a first convolution layer 122 and a second convolution layer 124, and the one RELU layer is a first RELU layer 123. The average pooling layer 121, the first convolution layer 122, the first RELU layer 123 and the second convolution layer 124 sequentially process the image features, that is, the channel attention module first pools the global features, then further extracts the features by using the first convolution layer 122, and inputs the features after the first RELU layer 123 into the second convolution layer 124. The first RELU layer 123 can effectively prevent the occurrence of gradient explosion.

[0066] It should be noted that in the description of the present application, "first", "second", "third" and "fourth" are only used for differentiation, and cannot be understood as indicating or implying relative importance.

[0067] The pixel attention module is composed of two convolution layers and one RELU layer. The two convolution layers are a third convolution layer 125 and a fourth convolution layer 127, and the RELU layer is a second RELU layer 126. The processing order of the pixel attention module is in the order of the third convolution layer 125, the second RELU layer 126 and the fourth convolution layer 127. The results of the two are concatenated and output as the output of the attention module.

[0068] Figure 4 A schematic diagram of the context module 13 in the network framework provided in the present embodiment is shown in FIG. 13. Please refer to FIG. 13. Figures 1-4 In the present embodiment, the context module 13 includes two convolution layers and a plurality of hole convolution layers 132. The two convolution layers are an input convolution layer 131 and an output convolution layer 133. The input convolution layer 131 receives the features output by the attention mechanism module 12 and connects the plurality of hole convolution layers 132. Then, the input convolution layer 131 processes the input features through the plurality of hole convolution layers 132. The output convolution layer 133 obtains the results of the parallel operation of the plurality of hole convolution layers 132 to obtain the output of the context module 13. In the present embodiment, the convolution kernel of the input convolution layer 131 and the output convolution layer 133 is unchanged, and the convolution kernel of the output convolution layer 133 is 1*1 and the step is 1.

[0069] The context module 13 introduces a hollow convolution. If a normal convolution is used, the receptive field will gradually decrease with the increase of the convolution layer. By using the hollow convolution, the receptive field can be effectively expanded, so that the network can extract more effective information. Specifically, the context module 13 includes four hollow convolution layers 132, and the hollow rates of the four hollow convolution layers 132 are 1, 2, 3 and 4 respectively. By setting the hollow rates of the four hollow convolution layers 132, the receptive field can be further expanded, thereby helping to improve the image enhancement effect.

[0070] The spatial invariant convolution kernel will destroy the texture information of the image in the result, and may also produce over-smoothed artifacts. The deformable convolution has the ability to learn a more flexible convolution kernel, so that the extracted features can be more accurate by setting the deformable convolution layer 14, and the texture detail information of the image is enriched.

[0071] S04: Decoding the processed image features to obtain a preliminary enhanced image.

[0072] The network framework also includes a decoder 16. The decoder 16 decodes the processed image features to obtain a preliminary enhanced image. Specifically, the decoder 16 is composed of three deconvolution layers, and correspondingly, it can also be called three up-sampling layers. The design of the convolution kernel and the corresponding step length of the decoder 16 is the same as that of the encoder 11 stack, so that the processed image features are restored to the original resolution through the decoder 16, thereby obtaining a preliminary enhanced image.

[0073] S05: Obtaining a high-frequency image according to the preliminary enhanced image.

[0074] The network framework also includes a processing module. The processing module processes the preliminary enhanced image obtained by decoding, so that the final output clear image is more natural and complex human visual perception effect. The processing module includes a Gaussian sampling layer 15.

[0075] The sampling Gaussian sampling layer 15 processes the preliminary enhanced image to obtain a blurred image. The blurred image is a low-frequency image. The difference between the preliminary enhanced image and the low-frequency image is the high-frequency detail part of the image. The image corresponding to the high-frequency detail part is the high-frequency image.

[0076] S06: Outputting a clear image according to the high-frequency image and the preliminary enhanced image.

[0077] The preliminary enhanced image and the high-frequency image are combined to obtain a clear image. The detail part of the clear image is enhanced, and the texture information is more abundant. Specifically, step S06 can be executed by the processing module.

[0078] The network framework of the present application is obtained by contrast learning. Obviously, before the underwater image enhancement is realized through the network framework, a training step of obtaining the network framework can also be included, which comprises:

[0079] S1: Construct a training data set and pre-process.

[0080] The data set includes a plurality of data pairs, each data pair including a degraded image and a corresponding clear image, the degraded image being consistent with the content contained in the clear image, the difference being that the degraded image has color deviation, reduced contrast, blurred details, etc. Optionally, the selected data set is a public data set UIEBD, which contains various types of underwater image data pairs in the UIEBD data set, each data pair containing an underwater degraded image and a clear image. The present application selects 90 images as test data.

[0081] The selected images are pre-processed, which includes data augmentation processing, and the data augmentation processing includes random flipping and random cropping.

[0082] S2: Train the network framework using the data set by contrast learning.

[0083] The main idea of contrast learning is to construct positive and negative samples, and through the constraint of contrast loss, the generated result is closer to the positive sample and farther away from the negative sample.

[0084] The training process is as follows: the degraded image in the data pair is input, the network framework processes the input image and outputs the processed image, the image output by the network framework is compared with the corresponding clear image in the data pair, and the network framework is iteratively trained according to the comparison result, so that the image output by the network framework is closer to the clear image in the data pair.

[0085] Meanwhile, the loss function of the network framework provided by the present application includes clear image reconstruction loss L rec , contrast regularization loss L CR and dark channel prior loss L dark , and the formula of the overall loss function is as follows:

[0086] L total =λ rec ·L rec +λ CR ·L CR +λ dark ·L dark ;

[0087] Wherein, λ rec =1, λ CR =0.1, λ dark =1e-5 .

[0088] Specifically, the clear image reconstruction loss L rec is trained by calculating the L1 norm of the output of the network and the clear image in the dataset to constrain the reconstructed image at the pixel level in the spatial domain. Specifically, the loss function calculates the difference between the reconstructed clear image and the clear image at each pixel and performs a summation operation. To avoid negative loss function values, the L1 norm is calculated to measure the difference between the reconstructed clear image and the clear image at each pixel, as follows:

[0089]

[0090] where I represents the clear image in the dataset, represents the clear image output by the network, x represents the pixel points in the image, and m represents the total number of pixel points.

[0091] Unlike the clear image reconstruction loss L rec , the contrast regularization loss L CR considers processing the reconstructed image in the feature domain. The main idea is to extract feature information between the reconstructed image, the clear image, and the degraded image using a pre-trained encoder 11, such as VGG19-Net. The clear image is considered as a positive sample, and the extracted feature information is positive feature information. The degraded image is considered as a negative sample, and the extracted feature information is negative feature information. The main purpose of the contrast regularization loss is to make the reconstructed image features more similar to the positive feature information and more distant from the negative feature information, so that a clearer image can be obtained when restoring the image. The formula is as follows:

[0092]

[0093] where I represents the clear image in the dataset, represents the clear image output by the network, x represents the pixel points in the image, and G i represents the first layer, the third layer, the fifth layer, the ninth layer, and the thirteenth layer of the pre-trained VGG19-Net, I haze represents the degraded underwater image in the dataset, w i represents the weight corresponding to each layer of the network.

[0094] Dark channel prior loss L darkis a classic defogging method, and the dark channel prior refers to that in a clear image, some pixels have very low intensity in at least one RGB color channel, close to 0, and by using this characteristic, the dark channel prior can be calculated to make the result of the image clearer and more natural. The formula is as follows:

[0095]

[0096] L dark =‖J(I)‖1

[0097] Wherein, I represents a clear image in a data set, x, y is a pixel point of the image, J dark represents a dark channel, J C represents a colored channel, Omega (x) represents an image block with x as a center point, c represents a selected channel, r represents a red channel, g represents a green channel, and b represents a blue channel.

[0098] The embodiment of the application also provides a readable storage medium, and the readable storage medium stores a computer readable computer program. The computer program is executed by a processor, so that one or more steps in the above-mentioned underwater image enhancement method are realized. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center and the like integrated with one or more available medium sets.

[0099] Experimental example

[0100] The network framework of the application adopts Pytorch. In the training stage of the network framework, an Adam optimizer is used to train and optimize the network framework, and the parameters of the optimizer are respectively beta1=0.9, beta2=0.999. The algorithm model of the application is trained on an NVIDIA 2080Ti GPU. In the experiment, the batch size of the image is set to 8, and the input size of each image is 256x256. The learning rate used in the experiment is 2x10 -4 , and the decay mode of the learning rate is cosine annealing strategy. The network framework provided in the embodiment has a total of 160000 iterations, and is tested every 500 steps.

[0101] In order to verify the effect of the application on underwater image processing, the application performs quantitative and qualitative tests on the public data set UIEBD, as shown in Figure 5 and Figure 6 The qualitative experimental result comparison chart of two underwater images in the data set UIEBD is shown, and Figure 5 and Figure 6The underwater image in the underwater image enhancement method is the image in the data set UIEBD, and the clear image is the image obtained by using the method.

[0102] The peak signal-to-noise ratio PSNR is an objective standard for evaluating images, is based on the error between corresponding pixel points, that is, the image quality evaluation based on sensitive error, and the unit is dB.

[0103]

[0104]

[0105] Wherein, MSE represents the mean square error between the current image X and the reference image Y, H and W are the height and width of the image respectively, n is the number of bits per pixel, generally 8, and the larger the value of PSNR indicates the smaller the distortion degree of the image.

[0106] The structural similarity SSIM is a commonly used reference image quality evaluation index, which respectively measures the similarity of two pictures from brightness, contrast and structure.

[0107]

[0108]

[0109]

[0110] SSIM(X,Y)=[l(X,Y)] α [c(X,Y)] β [s(X,Y)] γ

[0111] Wherein, μ X , μ Y Indicate the mean of image X, Y, σ X , σ Y Indicate the variance of image X and Y, σ XY Indicate the covariance of image X and Y, C1, C2, C3 are constants, and α, β, γ are constants.

[0112] The value range of SSIM is [0, 1], and the closer the value of SSIM is to 1, the higher the similarity of the two pictures is, and the smaller the distortion degree of the image is.

[0113] Underwater image quality metric UIQM, UIQM performance index is a linear weighted combination of three evaluation parts:

[0114] UIQM = c1 x UICM + c2 x UISM + c3 x UIConM

[0115] Wherein, c1, c2, c3 are constants. UICM is measured from the perspective of color balance, the smaller the deviation of RGB three colors, the larger the variance, the more balanced the color distribution of the image on the three channels, the larger the color dynamic range of the image, the better the effect of UICM; UISM is measured from the perspective of image edge, the more edge information of the picture, the better the index of UISM; UIConM is mainly based on the calculation of the contrast of the image block, the higher the contrast of the image block, the higher the value of UIConM.

[0116] The results of the quantitative experiment on the randomly selected 90 images in the dataset UIEBD as the test set are shown in Table 1 as follows:

[0117] PSNR SSIM UIQM Test Set 21.5515 0.8958 3.2346

[0118] The data in the above table is the average value of the corresponding quantitative indicators obtained after processing all images in the test set.

Claims

1. An underwater image enhancement method, characterized in that, include: The underwater image to be enhanced is input into the network framework, which is obtained based on contrastive learning training. Feature extraction is performed on the underwater image to obtain image features; The image features are processed sequentially through an attention mechanism module, a context module, and a deformable convolutional layer; the attention mechanism module includes a channel attention mechanism module and a pixel attention mechanism module, which are cascaded together to process the image features; The context module includes an input convolutional layer, an output convolutional layer, and multiple dilated convolutional layers. The steps of the context module in processing the image features include: obtaining the features output by the attention mechanism module through the input convolutional layer and connecting the multiple dilated convolutional layers; processing the input features through the multiple dilated convolutional layers; and obtaining the result of the parallel operation of the multiple dilated convolutional layers through the output convolutional layer. The processed image features are decoded to obtain a preliminary enhanced image; The step of obtaining a high-frequency image based on the preliminary enhanced image includes: processing the preliminary enhanced image using a Gaussian sampling layer to obtain a low-frequency image; and obtaining the high-frequency image using the preliminary enhanced image and the low-frequency image. A clear image is output based on the high-frequency image and the preliminary enhanced image.

2. The underwater image enhancement method according to claim 1, characterized in that, The step of outputting a clear image based on the high-frequency image and the preliminary enhanced image includes: The preliminary enhanced image is combined with the high-frequency image to obtain the clear image.

3. The underwater image enhancement method according to claim 1, characterized in that, The underwater image enhancement method further includes a training step for obtaining the network framework, the training step comprising: A training dataset is constructed and preprocessed, the dataset comprising multiple data pairs, each data pair comprising a degraded image and a corresponding sharpened image; The network framework was trained using contrastive learning with the dataset.

4. The underwater image enhancement method according to claim 1, characterized in that, The loss function of the network framework includes sharp image reconstruction loss L. rec , Compare the regularization loss L CR and the prior loss L of the dark channel dark The formula for the overall loss function is as follows: L total =λ rec ·L rec +λ CR ·L CR +λ dark ·L dark ; Among them, l rec =1,λ CR =0.1,λ dark =1e -5 。 5. An underwater image enhancement system, characterized in that, Includes a network framework, which is obtained based on contrastive learning training; The network framework includes: An encoder, used for feature extraction from the underwater image to obtain image features; An attention mechanism module, a context module, and a deformable convolutional layer are sequentially configured to process the image features. The attention mechanism module includes a channel attention mechanism module and a pixel attention mechanism module, which are cascaded to process the image features. The context module includes an input convolutional layer, an output convolutional layer, and multiple dilated convolutional layers. The context module obtains the features output by the attention mechanism module through the input convolutional layer, connects the multiple dilated convolutional layers, processes the input features through the multiple dilated convolutional layers, and obtains the result of the parallel operation of the multiple dilated convolutional layers through the output convolutional layer to process the image features. A decoder, used to decode the processed image features to obtain a preliminary enhanced image; The processing module is used to process the preliminary enhanced image using a Gaussian sampling layer to obtain a low-frequency image, then obtain a high-frequency image through the preliminary enhanced image and the low-frequency image, and output a clear image based on the high-frequency image and the preliminary enhanced image.

6. The underwater image enhancement system according to claim 5, characterized in that, The encoder includes three downsampling layers, and the decoder includes three upsampling layers.

7. The underwater image enhancement system according to claim 5, characterized in that, The context module includes an input convolutional layer, an output convolutional layer, and four dilated convolutional layers. The input convolutional layer is used to process the output of the attention mechanism module and connect the four dilated convolutional layers. The four dilated convolutional layers process the features of the input. The output convolutional layer is used to obtain the result of the parallel operation of the four dilated convolutional layers. The void ratios of the four voided convolutional layers are 1, 2, 3 and 4, respectively.

8. A readable storage medium, characterized in that, The readable storage medium stores a computer program that is executed by a processor to implement the underwater image enhancement method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Underwater image enhancement method based on residual dual-attention network

    CN113313644A

  • Low-illumination image enhancement method utilizing time-frequency domain hierarchical processing

    CN114219722A