An underwater image enhancement method based on brightness compensation residual network

Through a method based on the brightness compensation residual network, combined with the RGB multi-scale residual sub-network and the V-channel brightness compensation sub-network, the color distortion, blur, and low contrast problems of underwater images are solved, the image detail information is improved, and more detailed information is achieved. Good image enhancement effect.

CN114881879BActive Publication Date: 2024-09-24YANSHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210541384.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2024-09-24
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

Existing underwater image enhancement technologies have problems such as color distortion, blur, and low contrast, and methods based on deep learning still have problems such as loss of some details and oversaturation.

Method used

A method based on brightness compensation residual network is adopted, through the combination of RGB multi-scale residual sub-network and V-channel brightness compensation sub-network, using multi-scale residual block and CAPAFE upsampling technology, combining perceptual loss, content loss and multi-scale structure Similarity loss is used to train and generate high-quality underwater images.

Benefits of technology

It effectively solves the problems of color distortion, blur, and low contrast of underwater images, improves image detail information, and generates pictures with corrected colors, enhanced details, and better overall effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114881879B
    Figure CN114881879B
Patent Text Reader

Abstract

The invention discloses an underwater image enhancement method based on a brightness compensation residual network, comprising acquiring a data set; data preprocessing: cutting pictures into the same size, converting RGB type pictures into HSV type, extracting V channel and saving separately; model training: putting RGB type training set into RGB multi-scale residual sub-network for training, obtaining enhancement network 1 and output result; putting V type training set into V channel brightness compensation sub-network for training, obtaining enhancement network 2 and output result; sending the two output results into enhancement reconstruction sub-network to obtain the final output result; model testing: putting the test set into the trained enhancement network 1 and enhancement network 2 respectively, sending the output results into the enhancement reconstruction sub-network together to obtain the enhanced underwater picture. The invention can solve the problems of color distortion, blur and low contrast of underwater images, and further improve the detail information of the image through brightness compensation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an underwater image enhancement method based on a brightness compensation residual network, and belongs to the technical field of underwater image enhancement. Background Art

[0002] In recent years, high-quality underwater images have been of great significance for surveying marine resources, protecting marine life, and defending marine security. However, due to the complexity of underwater imaging, the images obtained have serious quality problems, which is not conducive to information acquisition and in-depth research. Therefore, it is necessary to enhance and repair underwater images to further extract more useful information.

[0003] The problem of blurry, low contrast, and color distortion in underwater images is due to the special nature of light propagation underwater. Different wavelengths of light attenuate differently when propagating underwater, which causes color distortion in underwater images. Secondly, the scattering effect of suspended particles in the water on light causes blurry and low contrast in underwater images.

[0004] Underwater image processing technology is mainly divided into image enhancement methods based on non-physical models, image restoration methods based on physical models, and image enhancement methods based on deep learning. The non-physical model method mainly improves the effect by directly adjusting the pixel value of the image, but because it does not consider the optical characteristics of underwater imaging, it is easy to produce chromatic aberration and artifacts. The image restoration method based on the physical model is to establish a mathematical model of underwater image degradation, estimate the parameters according to the model, and then reversely obtain a clear underwater image, but the model is usually based on a priori assumptions and has certain limitations. Underwater image enhancement methods based on deep learning are divided into convolutional neural networks and adversarial generative networks. By constructing the corresponding network model and training with a large amount of paired data, low-quality underwater images can be converted into high-quality images, but there are still problems such as loss of some details and oversaturation. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide an underwater image enhancement method based on a brightness compensation residual network in response to the current status of the prior art, which can solve the problems of color distortion, blur, low contrast, etc. of underwater images, and further improve the detail information of the image through brightness compensation.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] The steps include:

[0008] S1. Obtain the data set required for network training: select underwater images and corresponding enhanced images as training sets and test sets;

[0009] S2, data preprocessing: process the size and type of the image accordingly;

[0010] S3, RGB multi-scale residual sub-network training: put the RGB type training set into the RGB multi-scale residual sub-network for training, and obtain the enhanced network model 1 and the output result y1;

[0011] S4, V channel brightness compensation sub-network training: put the V channel training set into the V channel brightness compensation sub-network for training, and obtain the enhanced network model 2 and the output result y2;

[0012] S5, enhanced reconstruction phase: put the output results y1 and y2 into the enhanced reconstruction sub-network for calculation to obtain the final enhanced result y;

[0013] S6, model testing: put the data set to be tested into the trained enhanced network 1 and enhanced network 2, and the enhanced image can be obtained after calculation through the enhanced reconstruction sub-network.

[0014] A further improvement of the technical solution of the present invention is that: in S1, 6400 underwater pictures and corresponding enhanced pictures are randomly selected from the public data sets UIEBD, EUVP, and UFO-120 as training sets; 1600 underwater pictures with or without corresponding enhanced pictures are randomly selected as test sets.

[0015] A further improvement of the technical solution of the present invention is that the specific steps of S2 include:

[0016] The training set and test set are cropped to a size of 256×256; the original training set and test set are of RGB type, and the RGB type is converted to HSV type, and the brightness channel V is extracted and saved separately.

[0017] A further improvement of the technical solution of the present invention is that the specific steps of S3 include:

[0018] The RGB multi-scale residual subnetwork consists of 2 convolutional layers, 3 multi-scale residual blocks and 1 activation function. The input is an RGB type underwater image x1, the label is the corresponding RGB type enhanced image b1, and the output is an RGB type enhanced image y1; the loss uses the perceptual loss L con A linear combination of L2 and content loss;

[0019] The first convolutional layer converts the 3 channels of the input image x1 into 64 channels, and sends them to three consecutive multi-scale residual blocks for feature extraction through the RELU activation function. Finally, the number of channels is converted to 3 through the second convolutional layer to obtain the generated enhanced image y1;

[0020] The multi-scale residual block contains 4 channels: the first channel is not processed, the second channel uses two 3×3 convolutions, and the third channel uses two 3×3 dilated convolutions, which increases the receptive field without introducing additional calculations. The fourth channel uses the res2net module to replace the original 3×3 convolution with three 3×3 convolutions, which increases the receptive field. The output of the first convolution layer of the second channel and the output of the first convolution layer of the third channel are concatenated as the input of the second convolution layer of the second channel and the input of the second convolution layer of the third channel. The output of the second channel and the output of the third channel are concatenated, and then added to the output of the first channel and the fourth channel through 1×1 convolution as the output of the entire multi-scale residual block.

[0021] Content loss L 21 It is to calculate the pixel-to-pixel loss between the enhanced image y1 and the label b1;

[0022]

[0023] where y i is the enhanced result of RGB multi-scale residual sub-network training, b i is the enhanced image corresponding to the input image, and n is the number of training images;

[0024] Perceptual loss L con1 Calculate the loss between the enhanced image y1 and the high-level perceptual features of the label b1, using the VGG19 model pre-trained on ImageNet;

[0025]

[0026] where y i is the enhanced result of RGB multi-scale residual sub-network training, b i is the enhanced image corresponding to the input image, φ is the pre-trained VGG19 network, j represents the jth layer of the network, C j H j W j is the shape of the feature map of the jth layer, and n is the number of training images;

[0027] Total loss L t1 is the content loss L 21 and the perceptual loss L con1 Linear combinations of

[0028] L t1 =L2+L con1 .

[0029] A further improvement of the technical solution of the present invention is that the specific steps of S4 include:

[0030] The V channel brightness compensation network includes convolutional layers, pooling layers, multi-scale residual blocks, upsampling and activation functions. The input is the V channel underwater image x2, the label is the corresponding V channel enhanced image b2, and the output is the V channel enhanced image y2; the loss uses the perceptual loss L con , content loss L2 and multi-scale structural similarity loss L ms_ssim Linear combinations of

[0031] The first convolutional layer converts the single channel of the input image x2 into 64 channels, and obtains the feature f1 through the RELU activation function. After adaptive pooling, the size of the image is changed from 256×256 to 128×128, and then through 1×1 convolution, the number of channels is changed from 64 to 128, and sent to the first multi-scale residual block to obtain the feature f2. After adaptive pooling, the size of the image is changed from 128×128 to 64×64, and then through 1×1 convolution, the number of channels is changed from 128 to 256, and sent to the second multi-scale residual block to obtain the feature f3, f3 is adaptively pooled to change the size of the image from 64×64 to 32×32, and then through 1×1 convolution, the number of channels is changed from 256 to 512, and sent to the third multi-scale residual block to obtain feature f4, f2, f3, and f4 are subjected to 1×1 convolution, and the number of channels is changed to 64. After upsampling, f4 is residually connected with f3, and the obtained features are residually connected with f2 after upsampling. The obtained features are residually connected with f1 after upsampling, and finally the enhanced V channel image y2 is obtained through 3×3 convolution;

[0032] Content loss L 22 It is to calculate the pixel-to-pixel loss between the enhanced image y2 and the label b2;

[0033]

[0034] where y i is the enhanced result of V channel brightness compensation sub-network training, b i is the enhanced image corresponding to the input image, and n is the number of training images;

[0035] Perceptual loss L con2 The loss between the high-level perceptual features of the enhanced image y2 and the label b2 is calculated using the VGG19 model pre-trained on ImageNet. Since both the enhanced image y2 and the label b2 are single-channel, the input of the VGG19 model is 3-channel, which needs to be expanded to 3 channels when calculating the loss.

[0036]

[0037] where y i is the enhanced result of V channel brightness compensation sub-network training, b iis the enhanced image corresponding to the input image, φ is the pre-trained VGG19 network, j represents the jth layer of the network, C j H j W j is the shape of the feature map of the jth layer, and n is the number of training images;

[0038] The multi-scale structural similarity loss Lms_ssim is based on the multi-layer SSIM loss, taking into account resolution, brightness, contrast, and structural indicators;

[0039]

[0040] Where M represents different scales, μ p , μ g Respectively represent the mean of y2 and b2, σ p , σ g represents the standard deviation between y2 and b2, σ pg represents the covariance between y2 and b2, β m , γ m Indicates the relative importance between the two terms, c1, c2 are constant terms to prevent the divisor from being zero;

[0041] Total loss L t2 is the content loss L 21 , Perceptual loss L con1 and multi-scale structural similarity loss L ms_ssim A linear combination of:

[0042] L t2 =L2+L con1 +L ms_ssim .

[0043] A further improvement of the technical solution of the present invention is that: S5 specifically includes:

[0044] The enhanced reconstruction sub-network converts the output y1 of the RGB multi-scale residual sub-network into the HSV type, linearly combines the V channel value with the output y2 of the V channel brightness compensation sub-network to obtain the V channel value of the final enhanced image, merges it with the HS channel of y1 into a new HSV type, and then converts it to the RGB type, combining the advantages of the two networks to obtain the final enhanced image y.

[0045] Due to the adoption of the above technical solution, the technical progress achieved by the present invention is:

[0046] The present invention proposes an underwater image enhancement method based on a brightness compensation residual network, and proposes a novel multi-scale residual block in an RGB enhancement subnetwork based on a multi-scale residual block. The advantage of using a dilated convolution in the third channel is that the receptive field is expanded while reducing the amount of calculation. The fourth channel replaces the ordinary 3*3 convolution with a res2net module, which expands the receptive field while reducing the amount of calculation. Through residual connection, shallow detail information and high-level semantic information are integrated, so that the color of the generated picture is corrected and the details are enhanced. The V channel enhancement subnetwork based on brightness compensation adopts a CAPAFE upsampling method to perform feature reorganization based on input features, which has a larger receptive field and a small amount of calculation during feature reorganization. Multi-scale feature fusion integrates shallow detail information and high-level semantic information, and the details are further supplemented. The enhanced reconstruction subnetwork combines the advantages of the two, so that the final generated picture has a better effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 is a flow chart of an embodiment of the present invention;

[0048] Figure 2 is a schematic diagram of a network structure of an embodiment of the present invention;

[0049] Figure 3 is a schematic diagram of the structure of a multi-scale residual block according to an embodiment of the present invention;

[0050] Figure 4 It is a schematic diagram of the structure of the res2net module according to an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0053] Figure 1 The present invention is a flowchart of an underwater image enhancement method based on a brightness compensation residual network according to an embodiment of the present invention.

[0054] See also Figure 1 , the underwater image enhancement method of the embodiment, the specific steps are as follows:

[0055] Step S1: Obtain the data set required for network training by selecting underwater images and corresponding enhanced images as training sets and test sets;

[0056] 6400 underwater images and corresponding enhanced images are randomly selected from the public datasets UIEBD, EUVP, and UFO-120 as training sets, which are used to train the network model; 1600 underwater images and corresponding enhanced images are randomly selected as test sets, which may not include corresponding enhanced images, and are used to evaluate the performance and generalization ability of the model;

[0057] Step S2: Data preprocessing, processing the size and type of the image accordingly;

[0058] The training set and test set are cropped to a size of 256×256 to facilitate calculation and reduce memory usage;

[0059] The original training set and test set are of RGB type. We need to convert the RGB type to HSV type, extract the brightness channel V and save it separately.

[0060] Step S3: RGB multi-scale residual sub-network training; put the RGB type training set into the RGB multi-scale residual sub-network for training to obtain the enhanced network model 1 and the output result y1;

[0061] The multi-scale residual sub-network is as follows Figure 2 As shown:

[0062] The RGB multi-scale residual subnetwork is composed of 2 convolutional layers, 3 multi-scale residual blocks, and 1 activation function. The input is an RGB type underwater image x1, the label is the corresponding RGB type enhanced image b1, and the output is an RGB type enhanced image y1; the loss used is the perceptual loss L con1 and content loss L 21 Linear combinations of

[0063] The first convolutional layer has a convolution kernel size of 3×3, a step size of 1, and a padding of 1. It converts the 3 channels of the input image x1 into 64 channels, and sends them to three consecutive multi-scale residual blocks for feature extraction through the RELU activation function. Finally, it passes through the second convolutional layer with a convolution kernel size of 3×3, a step size of 1, and a padding of 1. It converts the number of output channels of the multi-scale residual block from 64 to 3, and obtains the generated enhanced image y1.

[0064] The multi-scale residual block is Figure 3 As shown:

[0065] The input parameter of the multi-scale residual block is feat, which is used to set the number of input and output channels in the multi-scale residual block. The multi-scale residual block contains 4 channels: the first channel is not processed, and the second channel uses two 3×3 convolutions with a step size of 1 and a padding of 1. However, the number of input and output channels of the two convolutional layers is different. The number of input and output channels of the first convolutional layer is feat, and the number of input and output channels of the second convolutional layer is feat×2; the third channel uses two 3×3 dilated convolutions with a dilation rate of 2, a step size of 1, and a padding of 1. However, the number of input and output channels of the two convolutional layers is different. The number of input and output channels of the first convolutional layer is feat, and the number of input and output channels of the second convolutional layer is feat×2. The number of input and output channels is feat×2, which increases the receptive field without introducing additional parameters. The fourth channel uses the res2net module to replace the original 3×3 convolution with three 3×3 convolutions, which increases the receptive field. The output of the first convolution layer of the second channel and the output of the first convolution layer of the third channel are concatenated as the input of the second convolution layer of the second channel and the input of the second convolution layer of the third channel. The output of the second channel and the output of the third channel are concatenated and then added to the output of the first channel and the fourth channel through a 1×1 convolution as the output of the entire multi-scale residual block. The role of the 1×1 convolution layer is to change the number of channels of the spliced ​​features from feat×4 to feat. The feat of the multi-scale residual block used in the RGB multi-scale residual subnetwork is set to 64.

[0066] The res2net module is as follows Figure 4 As shown:

[0067] Res2net module structure: After the input features are convolved by 1×1, the features are divided into 4 parts. The first part is not processed; the second part is output by 3×3 convolution; the third part is added with the output of the second part and then output by 3×3 convolution; the fourth part is added with the output of the third part and then output by 3×3 convolution; the outputs of the four parts are concatenated and output by 1×1;

[0068] Content loss L 21 It is to calculate the pixel-to-pixel loss between the enhanced image y1 and the label b1;

[0069]

[0070] where y i is the enhanced result of RGB multi-scale residual sub-network training, b i is the enhanced image corresponding to the input image, and n is the number of training images;

[0071] Perceptual loss L con1Calculate the loss between the enhanced image y1 and the high-level perceptual features of the label b1, using the VGG19 model pre-trained on ImageNet;

[0072]

[0073] where y i is the enhanced result of RGB multi-scale residual sub-network training, b i is the enhanced image corresponding to the input image, φ is the pre-trained VGG19 network, j represents the jth layer of the network, C j H j W j is the shape of the feature map of the jth layer, and n is the number of training images;

[0074] Total loss L t1 is the content loss L 21 and the perceptual loss L con1 A linear combination of:

[0075] L t1 =L2+L con1 .

[0076] Step S4: V channel brightness compensation sub-network training: Put the V channel training set into the V channel brightness compensation sub-network for training to obtain the enhanced network model 2 and the output result y2;

[0077] The V channel brightness compensation network consists of convolutional layers, pooling layers, multi-scale residual blocks, upsampling, and activation functions. The input is the V channel underwater image x2, the label is the corresponding V channel enhanced image b2, and the output is the V channel enhanced image y2; the loss uses the perceptual loss L con , content loss L2 and multi-scale structural similarity loss L ms_ssim Linear combinations of

[0078] The convolution kernel size of the first convolution layer is 3×3, the step size is 1, and the padding is 1. Its function is to convert the 1 channel of the input image x2 into 64 channels. After the RELU activation function, the feature f1 is obtained. After adaptive pooling, the size of f1 is changed from 256×256 to 128×128. Then, through 1×1 convolution, the number of channels is changed from 64 to 128. It is sent to the first multi-scale residual block to obtain the feature f2. The feat of the first multi-scale residual block is set to 128. After adaptive pooling, f2 is converted The size of the image changes from 128×128 to 64×64, and then through 1×1 convolution, the number of channels changes from 128 to 256, and is sent to the second multi-scale residual block to obtain feature f3. The feat of the second multi-scale residual block is set to 256. After adaptive pooling, f3 changes the size of the image from 64×64 to 32×32, and then through 1×1 convolution, the number of channels changes from 256 to 512, and is sent to the third multi-scale residual block to obtain feature f4. The feat of the third multi-scale residual block is set to 512. After 1×1 convolution, the number of channels of f2, f3, and f4 changes to 64. After upsampling, f4 is residually connected with f3. The obtained features are then upsampled and residually connected with f2. The obtained features are then upsampled and residually connected with f1. Finally, the enhanced V channel image y2 is obtained through 3×3 convolution;

[0079] Content loss L 22 It is to calculate the pixel-to-pixel loss between the enhanced image y2 and the label b2;

[0080]

[0081] where y i is the enhanced result of the V channel brightness compensation sub-network training, b i is the enhanced image corresponding to the input image, and n is the number of training images;

[0082] Perceptual loss L con2 The loss between the high-level perceptual features of the enhanced image y2 and the label b2 is calculated using the VGG19 model pre-trained on ImageNet. Since both the enhanced image y2 and the label b2 are single-channel, the input of the VGG19 model is 3-channel, which needs to be expanded to 3 channels when calculating the loss;

[0083]

[0084] where y i is the enhanced result of the V channel brightness compensation sub-network training, b i is the enhanced image corresponding to the input image, φ is the pre-trained VGG19 network, j represents the jth layer of the network, C j H j W jis the shape of the feature map of the jth layer, and n is the number of training images;

[0085] The multi-scale structural similarity loss Lms_ssim is based on the multi-layer SSIM loss, taking into account resolution, brightness, contrast, and structural indicators.

[0086]

[0087] Where M represents different scales, μ p , μ g Represent the mean of y2 and b2, σ p , σ g represents the standard deviation between y2 and b2, σ pg represents the covariance between y2 and b2, β m , γ m Indicates the relative importance between the two terms, c1, c2 are constant terms to prevent the divisor from being zero;

[0088] Total loss L t2 is the content loss L 21 , Perceptual loss L con1 and multi-scale structural similarity loss L ms_ssim A linear combination of:

[0089] L t2 =L2+L con1 +L ms_ssim

[0090] Step S5: Enhanced reconstruction phase: put the output results y1 and y2 into the enhanced reconstruction sub-network for calculation to obtain the final enhanced result y;

[0091] The enhanced reconstruction sub-network converts the output y1 of the RGB multi-scale residual sub-network into the HSV type, linearly combines the V channel value with the output y2 of the V channel brightness compensation sub-network to obtain the V channel value of the final enhanced image, and merges it with the HS channel of y1 into a new HSV type, and then converts it to the RGB type, combining the advantages of the two networks to obtain the final enhanced image y;

[0092] Step S6: Model testing: put the data set to be tested into the trained enhanced network 1 and enhanced network 2, and the enhanced image can be obtained after calculation through the enhanced reconstruction sub-network;

[0093] The underwater image enhancement method based on the brightness compensation residual network of this embodiment proposes a new type of multi-scale residual block in the RGB enhancement sub-network based on the multi-scale residual block. The advantage of using the hole convolution in the third channel is that it expands the receptive field while reducing the amount of calculation. The fourth channel uses the res2net module to expand the receptive field while reducing the amount of calculation; through the residual connection, the shallow detail information is integrated with the high-level semantic information, so that the color of the generated picture is corrected and the details are enhanced; the V channel enhancement sub-network based on brightness compensation adopts the CAPAFE upsampling method to perform feature reorganization based on the input features, which has a larger receptive field and a small amount of calculation when the features are reorganized; multi-scale feature fusion integrates the shallow detail information with the high-level semantic information, and the details are further supplemented. The enhanced reconstruction sub-network combines the advantages of the two, so that the final generated picture has a better effect.

[0094] As for the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0095] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. An underwater image enhancement method based on a brightness compensation residual network, characterized in that: The steps include: S1. Obtain the data set required for network training: select underwater images and corresponding enhanced images as training sets and test sets; S2, data preprocessing: process the size and type of the image accordingly; S3, RGB multi-scale residual sub-network training: put the RGB type training set into the RGB multi-scale residual sub-network for training, and obtain the enhanced network model 1 and the output result y1; The specific steps of S3 include: The RGB multi-scale residual subnetwork consists of 2 convolutional layers, 3 multi-scale residual blocks and 1 activation function. The input is an RGB type underwater image x1, the label is the corresponding RGB type enhanced image b1, and the output is an RGB type enhanced image y1; the loss uses the perceptual loss L con A linear combination of L2 and content loss; The first convolutional layer converts the 3 channels of the input image x1 into 64 channels, and sends them to 3 consecutive multi-scale residual blocks for feature extraction through the RELU activation function. Finally, the number of channels is converted to 3 through the second convolutional layer to obtain the generated enhanced image y1; The multi-scale residual block contains 4 channels: the first channel is not processed, the second channel uses two 3×3 convolutions, and the third channel uses two 3×3 dilated convolutions, which increases the receptive field without introducing additional calculations. The fourth channel uses the res2net module to replace the original 3×3 convolution with three 3×3 convolutions, which increases the receptive field. The output of the first convolution layer of the second channel and the output of the first convolution layer of the third channel are concatenated as the input of the second convolution layer of the second channel and the input of the second convolution layer of the third channel. The output of the second channel and the output of the third channel are concatenated, and then added to the output of the first channel and the fourth channel through 1×1 convolution as the output of the entire multi-scale residual block. Content loss L 21 It is to calculate the pixel-to-pixel loss between the enhanced image y1 and the label b1; where y i is the enhanced result of RGB multi-scale residual sub-network training, b i is the enhanced image corresponding to the input image, and n is the number of training images; Perceptual loss L con1 Calculate the loss between the enhanced image y1 and the high-level perceptual features of the label b1, using the VGG19 model pre-trained on ImageNet; where y i is the enhanced result of RGB multi-scale residual sub-network training, b i is the enhanced image corresponding to the input image, φ is the pre-trained VGG19 network, j represents the jth layer of the network, C j H j W j is the shape of the feature map of the jth layer, and n is the number of training images; Total loss L t1 is the content loss L 21 and the perceptual loss L con1 Linear combinations of L t1 =L2+L con1 ; S4, V channel brightness compensation sub-network training: put the V channel training set into the V channel brightness compensation sub-network for training, and obtain the enhanced network model 2 and the output result y2; The specific steps of S4 include: The V channel brightness compensation network includes convolutional layers, pooling layers, multi-scale residual blocks, upsampling and activation functions. The input is the V channel underwater image x2, the label is the corresponding V channel enhanced image b2, and the output is the V channel enhanced image y2; the loss uses the perceptual loss L con , content loss L2 and multi-scale structural similarity loss L ms_ssim Linear combinations of The first convolutional layer converts the single channel of the input image x2 into 64 channels, and obtains the feature f1 through the RELU activation function. After adaptive pooling, the size of the image is changed from 256×256 to 128×128, and then through 1×1 convolution, the number of channels is changed from 64 to 128, and sent to the first multi-scale residual block to obtain the feature f2. After adaptive pooling, the size of the image is changed from 128×128 to 64×64, and then through 1×1 convolution, the number of channels is changed from 128 to 256, and sent to the second multi-scale residual block to obtain the feature f3, f3 is adaptively pooled to change the size of the image from 64×64 to 32×32, and then through 1×1 convolution, the number of channels is changed from 256 to 512, and sent to the third multi-scale residual block to obtain feature f4, f2, f3, and f4 are subjected to 1×1 convolution, and the number of channels is changed to 64. After upsampling, f4 is residually connected with f3, and the obtained features are residually connected with f2 after upsampling. The obtained features are residually connected with f1 after upsampling, and finally the enhanced V channel image y2 is obtained through 3×3 convolution; Content loss L 22 It is to calculate the pixel loss between the enhanced image y2 and the label b2; where y i is the enhanced result of V channel brightness compensation sub-network training, b i is the enhanced image corresponding to the input image, and n is the number of training images; Perceptual loss L con2 The loss between the high-level perceptual features of the enhanced image y2 and the label b2 is calculated using the VGG19 model pre-trained on ImageNet. Since both the enhanced image y2 and the label b2 are single-channel, the input of the VGG19 model is 3-channel, which needs to be expanded to 3 channels when calculating the loss. where y i is the enhanced result of V channel brightness compensation sub-network training, b i is the enhanced image corresponding to the input image, φ is the pre-trained VGG19 network, j represents the jth layer of the network, C j H j W j is the shape of the feature map of the jth layer, and n is the number of training images; The multi-scale structural similarity loss Lms_ssim is based on the multi-layer SSIM loss, taking into account resolution, brightness, contrast, and structural indicators; Where M represents different scales, μ p , μ g Respectively represent the mean of y2 and b2, σ p , σ g represents the standard deviation between y2 and b2, σ pg represents the covariance between y2 and b2, β m , γ m Indicates the relative importance between the two terms, c1, c2 are constant terms to prevent the divisor from being zero; Total loss L t2 is the content loss L 21 , Perceptual loss L con1 and multi-scale structural similarity loss L ms_ssim A linear combination of: L t2 =L2+L con1 +L ms_ssim ; S5, enhanced reconstruction phase: put the output results y1 and y2 into the enhanced reconstruction sub-network for calculation to obtain the final enhanced result y; S6, model testing: put the data set to be tested into the trained enhanced network 1 and enhanced network 2, and the enhanced image can be obtained after calculation through the enhanced reconstruction sub-network.

2. The underwater image enhancement method based on brightness compensation residual network according to claim 1, characterized in that: In S1, 6400 underwater images and corresponding enhanced images are randomly selected from the public data sets UIEBD, EUVP, and UFO-120 as training sets; 1600 underwater images with or without corresponding enhanced images are randomly selected as test sets.

3. The underwater image enhancement method based on brightness compensation residual network according to claim 1, characterized in that: The specific steps of S2 include: The training set and test set are cropped to a size of 256×256; the original training set and test set are of RGB type, and the RGB type is converted to HSV type, and the brightness channel V is extracted and saved separately.

4. The underwater image enhancement method based on brightness compensation residual network according to claim 1, characterized in that: The S5 specifically includes: The enhanced reconstruction sub-network converts the output y1 of the RGB multi-scale residual sub-network into the HSV type, linearly combines the V channel value with the output y2 of the V channel brightness compensation sub-network to obtain the V channel value of the final enhanced image, merges it with the HS channel of y1 into a new HSV type, and then converts it to the RGB type, combining the advantages of the two networks to obtain the final enhanced image y.