Underwater image enhancement method and electronic device based on deep learning

By introducing fast average normalization, channel dynamic range and local color distribution sensitive loss function in the underwater image enhancement method, combined with TensorRT optimization, the problem of underwater image enhancement speed and quality in the prior art is solved, and the problem of underwater image enhancement speed and quality is realized. Real-time enhancement and high-quality output on resource-constrained devices.

CN118840274BActive Publication Date: 2025-01-07SANYA INST OF OCEANOGRAPHY OCEAN UNIV OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411310433.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-07
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

Existing fast underwater image enhancement methods based on deep learning cannot meet the needs of modern underwater robots to process 4K high-resolution images in real time. The enhanced image quality is poor, the robustness is insufficient, and the pixel-level loss training models used are common. The problem of insufficient saturation.

Method used

A method of underwater image enhancement based on deep learning is designed, using fast average normalization module, channel dynamic range module, PBP-D module and PBP-R module, and optimize the model through mixed accuracy, combined with local color distribution sensitive loss function , improve the robustness and enhancement effect of the model, and perform inference optimization through TensorRT.

Benefits of technology

Real-time enhancement of 4K resolution underwater images on a variety of resource-constrained devices is achieved, improving the robustness and saturation of the enhancement results, taking into account high inference speed and high quality effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118840274B_ABST
    Figure CN118840274B_ABST
Patent Text Reader

Abstract

The present invention discloses an underwater image enhancement method and electronic device based on deep learning, belonging to the field of image enhancement technology. The method comprises: obtaining an underwater image enhancement data set; constructing an underwater image enhancement model, using the underwater image enhancement data set to train the underwater image enhancement model and obtain the training model weight; using the high-performance neural network inference engine TensorRT to perform mixed precision optimization on the training model weight to obtain an optimized underwater image enhancement model; importing the optimized underwater image enhancement model into an underwater robot, and inputting the underwater image obtained by the underwater robot into the optimized underwater image enhancement model to obtain an enhanced underwater image and output it. The present invention provides an effective solution for improving the underwater image enhancement effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image enhancement technology, and more specifically to an underwater image enhancement method and electronic equipment based on deep learning. Background Art

[0002] With the improvement of underwater image enhancement datasets, many underwater enhancement models have been proposed to deal with problems such as color distortion, low contrast, and scattering noise in underwater images. Although most learning-based models can improve the visual quality of underwater images by increasing the depth and width of neural networks, they usually require more storage space and more computation, which makes it challenging to deploy these underwater enhancement models on mobile devices with limited computing resources.

[0003] Existing fast underwater image enhancement methods based on deep learning mainly improve the reasoning speed by reducing the amount of calculation, such as gradually reducing the size of feature maps at each stage, reducing channel dimensions and layers, and adopting convolution with high computational efficiency. However, the models designed according to these ideas are not enough to meet the needs of modern underwater robots to process high-resolution images up to 4K in real time. When achieving fast underwater image enhancement, image quality often needs to be sacrificed. In order to strike a balance between high enhancement quality and fast reasoning, fast underwater image enhancement methods based on deep learning combined with normalization have recently shown greater advantages. Existing methods for enhancing robustness include adjusting normalization using threshold detection and replacing normalized boundary values ​​with lightweight attention modules. However, the normalization in these methods does not take into account the overly bright / dark areas caused by irregular lighting and other factors. Such normalization operations can lead to over-enhancement or under-enhancement, and excessive attention calculations can also lead to inefficient operation of the algorithm. Although many deep learning underwater enhancement methods in the prior art use L1 and L2 losses to measure the gap between the true value and the enhanced result, models trained using pixel-level losses such as L1 and L2 generally have the problem of insufficient saturation.

[0004] In summary, in the prior art, the fast underwater image enhancement method based on deep learning mainly has the following problems:

[0005] (1) The inference speed of the current underwater enhancement algorithm cannot meet the needs of modern underwater robots to process 4K high-resolution images in real time.

[0006] (2) The image quality enhanced by the current fast underwater image enhancement algorithm is not good.

[0007] (3) The current image enhancement algorithm that uses normalization combined with deep learning is not robust enough and the improved normalization method has poor operating efficiency.

[0008] (4) Underwater image enhancement models trained using pixel-level losses such as L1 and L2 generally suffer from the problem of insufficient saturation.

[0009] Therefore, how to provide an underwater image enhancement method and electronic device based on deep learning that can solve the above problems is an issue that technical personnel in this field urgently need to solve. Summary of the invention

[0010] In view of this, the present invention provides an underwater image enhancement method and electronic device based on deep learning, which are used to solve the technical problems existing in the above-mentioned prior art.

[0011] In order to achieve the above object, the present invention provides the following technical solutions:

[0012] A method for underwater image enhancement based on deep learning, comprising the following steps:

[0013] Get underwater image enhancement dataset;

[0014] Constructing an underwater image enhancement model, and using the underwater image enhancement dataset to train the underwater image enhancement model and obtain a training model weight;

[0015] The training model weights are optimized with mixed precision using the high-performance neural network inference engine TensorRT to obtain an optimized underwater image enhancement model;

[0016] The optimized underwater image enhancement model is imported into the underwater robot, and the underwater image acquired by the underwater robot is input into the optimized underwater image enhancement model to obtain the enhanced underwater image and output it.

[0017] Preferably, the underwater image enhancement model includes the following four parts:

[0018] The fast average normalization module, the channel dynamic range module, the PBP-D module and the PBP-R module are used to complete data preprocessing, feature extraction and image reconstruction tasks.

[0019] Preferably, the channel dynamic range module performs normalization, amplification and compression operations on the channel, and adjusts or enhances the information of the channel through the extreme dynamic range and compensation weight.

[0020] Preferably, the structure of the PBP-D module includes: a pixelunshuffle module and an anti-bottleneck module, wherein the anti-bottleneck module is composed of two convolutional layers;

[0021] The input image first passes through the pixelunshuffle module for pixelunshuffle operation, and then passes through the anti-bottleneck module composed of two convolutional layers to activate the feature map. The feature map processed by the anti-bottleneck module is restored to the size of the original input underwater image through the pixelshuffle module to obtain the final output result.

[0022] Preferably, the convolution kernel size of the convolution layer in the PBP-D module is 1*1.

[0023] Preferably, the expression of the activation function in the PBP-D module is:

[0024] ;

[0025] In the formula, tanh() means using the tanh activation function, and | | means taking the absolute value.

[0026] Preferably, the structure of the PBP-R module includes: a pixelunshuffle module and an anti-bottleneck module, wherein the anti-bottleneck module is composed of two convolutional layers;

[0027] The input image first passes through the pixelunshuffle module for pixelunshuffle operation, and then passes through the anti-bottleneck module composed of two convolutional layers to activate the feature map. The feature map processed by the anti-bottleneck module is restored to the size of the original input underwater image through the pixelshuffle module to obtain the final output result.

[0028] Preferably, the convolution kernel size of the convolution layer of the PBP-R module is 3*3.

[0029] Preferably, the expression of the activation function in the PBP-R module is:

[0030] ;

[0031] In the formula, tanh() means using the tanh activation function, and max(0,tanh()) means selecting a larger value between tanh() and 0.

[0032] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements an underwater image enhancement method based on deep learning when executing the computer program.

[0033] It can be seen from the above technical solutions that compared with the prior art, the present invention discloses an underwater image enhancement method and electronic device based on deep learning. Different from the idea of ​​reducing the amount of calculation and increasing the speed of the prior art, we designed a lightweight structure based on the idea of ​​achieving faster processing speed at the same resolution at the cost of more parameters. This structure can improve the efficiency of parallel computing and achieve excellent reasoning speed. At the same time, the present invention proposes a method of using average pooling to enhance robustness and accelerate normalization. In order to further improve the quality, the present invention adds weights to the neural network that reflect the correlation between dynamic range and enhancement quality. Since there is a significant difference in the local color distribution between the true value and the undersaturated image, the present invention proposes a local color distribution sensitive loss to reduce this difference to improve the accuracy of the saturation of the enhancement result. The specific beneficial effects are:

[0034] 1. The present invention can complete the task of real-time enhancement of 4K resolution underwater images on a variety of resource-constrained devices.

[0035] 2. The normalization method for underwater images proposed in the present invention can obtain more robust enhancement results.

[0036] 3. Using the adjusted dynamic range as the weight of the deep learning network can improve the enhancement effect.

[0037] 4. By using new loss functions and combinations of loss functions for training, more accurate enhancement results with saturation can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0039] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0040] Figure 2 A schematic diagram of the overall structure of the underwater image enhancement model provided by the present invention;

[0041] Figure 3 The PBP structure diagram provided by the present invention;

[0042] Figure 4 A schematic diagram of the structure of the fast average normalization (FAN) module provided by the present invention;

[0043] Figure 5A schematic diagram of the structure of a channel dynamic range (CDR) module provided by the present invention;

[0044] Figure 6 A schematic diagram of local color distribution loss provided by the present invention;

[0045] Figure 7 The present invention provides a flowchart of the method. DETAILED DESCRIPTION

[0046] 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.

[0047] The purpose of the present invention is to provide an underwater image enhancement method and electronic device based on deep learning, the method comprising: obtaining an underwater image enhancement data set; constructing an underwater image enhancement model, training the underwater image enhancement model using the underwater image enhancement data set and obtaining the training model weight; performing mixed precision optimization on the training model weight using the high-performance neural network inference engine TensorRT to obtain an optimized underwater image enhancement model; importing the optimized underwater image enhancement model into an underwater robot, and inputting the underwater image obtained by the underwater robot into the optimized underwater image enhancement model to obtain an enhanced underwater image and output it. The present invention provides an effective solution for improving the underwater image enhancement effect.

[0048] 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.

[0049] See also Figure 1 The embodiment of the present invention discloses an underwater image enhancement method based on deep learning, comprising the following steps:

[0050] Get underwater image enhancement dataset;

[0051] Construct an underwater image enhancement model, use the underwater image enhancement dataset to train the underwater image enhancement model and obtain the training model weights;

[0052] The training model weights are optimized with mixed precision using the high-performance neural network inference engine TensorRT to obtain an optimized underwater image enhancement model.

[0053] The optimized underwater image enhancement model is imported into the underwater robot, and the underwater image acquired by the underwater robot is input into the optimized underwater image enhancement model to obtain the enhanced underwater image and output it.

[0054] For details, see Figure 7 As shown, this embodiment first obtains public underwater image enhancement datasets such as UIEB, LSUI, etc. from the Internet, and then uses the collected datasets to train the proposed model using a computer and obtain the training model weights. The obtained model weights are optimized using fp32+fp16 mixed precision using TensorRT to obtain the optimized model. Finally, the model is imported into the underwater robot. When in use, the underwater image is first obtained through the camera of the underwater robot, and then input into the optimized model, and then the enhanced underwater image is obtained.

[0055] In a specific embodiment, the overall structure of the underwater image enhancement model is as follows: Figure 2 The underwater image enhancement model of this embodiment consists of four parts: fast average normalization (FAN), channel dynamic range (CDR), pixelunshuffle-bottleneck-pixelshuffle-distance (PBP-D) and pixelunshuffle-bottleneck-pixelshuffle-relu (PBP-R).

[0056] Specifically, for all convolutional layers in the underwater image enhancement model, the stride is set to 1; the padding is 1. 2 " indicates that the output channel of the convolutional layer is 64, the kernel size is 3 × 3, and the number of input channels is 3 × n 2 .

[0057] In a specific implementation, assuming that the underwater image enhancement model processes the underwater image I to obtain the enhanced image O, the processing process of DNnet can be expressed as the following equation:

[0058]

[0059] Among them, D is the feature map obtained by PBP-D of the original underwater image, R is the feature map output by PBP-R of the original underwater image, C is the weight output by CDR, ⊗ represents element multiplication, and FAN() is the functional representation of the FAN module.

[0060] Specifically, unlike the underwater image enhancement method Fusion proposed by Ancuti et al., which only compensates for the red and blue channels, this embodiment believes that due to the absorption process in the underwater environment, the red, green and blue channels will all degrade. Therefore, this embodiment uses a lightweight neural network to learn the compensation of all channels. Unlike the white balance method with compensation in Fusion (Ancuti et al., 2017), this embodiment replaces the compensation part with C⊗R⊗D. Since the white balance method does not support back propagation, this embodiment introduces FAN to replace the white balance method of Fusion for color balance and reduce the risk of over- or under-enhancement during normalization.

[0061] In a specific embodiment, see Figure 3 Both PBP-D and PBP-R are designed based on the PBP structure. The input image first undergoes a pixelunshuffle operation to reduce the length and width of the input image while increasing the number of channels. Then it passes through an anti-bottleneck structure consisting of two convolutional layers, in which fa is used to activate the feature map. Finally, the feature map processed by the anti-bottleneck structure is restored to the size of the original input underwater image through a pixelshuffle operation to obtain the final output result. There are two main differences between PBP-D and PBP-R. First, the convolution kernel size of the convolution layer in PBP-D is 1*1, and the convolution kernel size of the convolution layer in PBP-R is 3*3. Secondly, the activation function in PBP-D uses the activation function shown in formula (2), and the activation function in PBP-R uses the activation function shown in formula (3).

[0062] (2)

[0063] (3)

[0064] In formula (2) and formula (3), x represents the input of the activation function, tanh() represents the use of the tanh activation function, || represents taking the absolute value, and max(0,tanh(x)) represents selecting a larger value between tanh(x) and 0.

[0065] Specifically, in order to design an efficient UIE model for parallel computing, this embodiment proposes a pixelunshuffle-bottleneck-pixelshuffle (PBP) structure (Figure 3). Unlike the traditional bottleneck strategy, it allows the expansion ratio to be automatically adjusted with the size of the feature map being processed. The proposed PBP structure includes paired pixelshuffle and pixelunshuffle operations, which can reduce the size of the feature map while forcing the channels and computational amount of the inverse bottleneck to remain unchanged. This strategy can speed up the inference speed by amplifying the number of parameters by n2 times. Although this strategy will lead to an increase in parameters, when the memory of the model parameters is much smaller than the memory occupied by the feature map, the additional memory usage caused by the increase in parameters will not significantly affect the inference speed. Since the parameter cardinality of the proposed PBP module is very small (much smaller than the occupancy of the feature map), the PBP structure of this embodiment can effectively save GPU inference time.

[0066] Since the PBP structure consists of general convolutions, the computational effort of the convolutional layers near the head and back in the PBP can be calculated according to the following formula.

[0067] ;

[0068] ;

[0069] The computational cost depends on the number of input channels of PBP: 2 The number of output channels of PBP is N × n 2 , the number of output channels of the first convolutional layer or the number of input channels of the latter convolutional layer is H, and the kernel size is and feature map size , n is the magnification factor in pixel shuffle or the reduction factor in pixel unshuffle. In the method of this embodiment, H is fixed to 64. PBP with different parameters n 2 ×1 / n 2 = 1 and thus have the same computational complexity. By keeping the computational complexity constant and using more parameters as n increases, the computational efficiency of the model can be significantly improved.

[0070] Specifically, since PBP has a symmetrical structure at both ends, the calculation formulas only differ in the variable names. Both formulas contain the channel number variable H (representing the number of output channels of the first convolutional layer or the number of input channels of the back convolutional layer, H), which helps to understand the feature that the number of channels in the middle of the PBP structure is fixed.

[0071] Specifically, PBP-D and PBP-R are different from the prior art total fusion which compensates based on the distance between the green channel and other channels. This embodiment proposes PBP-D (D represents distance) based on PBP, and adopts formula (2) to enable the model to learn the distance relationship between all channels. PBP-D also uses a 1*1 convolution kernel to minimize computational cost. The use of element multiplication can significantly increase the feature representation dimension without incurring any additional computational overhead within the layer. Therefore, this embodiment introduces PBP-R (R refers to ReLU), which adopts formula (3) and performs element multiplication with PBP-D to enrich the nonlinear fitting ability of the model of this embodiment, such as Figure 2 Another advantage of the element-wise operation between PBP-R and PBP-D is that the bottleneck structure in PBP-D and PBP-R can achieve a larger compression ratio between input and output channels.

[0072] In a specific embodiment, the working process and structure of the FAN module are as follows: Figure 4 As shown, the feature map X input to the FAN module is first average pooled to generate X A , and then X A And X according to formula (4) to get the output result O. i,j (), max i,j () indicates finding the minimum and maximum values ​​in the H and W dimensions respectively. ε n is a very small constant used to prevent the denominator from being zero.

[0073] Specifically, according to the existing underwater image enhancement technology, applying normalization to neural networks can more effectively enhance underwater images. Due to the scattering and absorption phenomena in the underwater environment, some over-bright / over-dark areas will be generated in the underwater image, which will affect the robustness of normalization. Therefore, this embodiment uses average pooling to reduce the risk of over- or under-enhancement and improve the performance of normalization. This embodiment proposes a fast average normalization (FAN) module (Figure 4) to normalize the input X. The module first performs average pooling on X to obtain XA to reduce the impact of over-bright / over-dark areas.

[0074] In a specific embodiment, the workflow and structure of the channel dynamic range (CDR) module are as follows: Figure 5 As shown. The CDR module first uses average pooling on the input image I to obtain I A Then use formula (5) to find I A After obtaining DR, the compensation weight C is obtained using formula (6), where p is 5.

[0075] (4)

[0076] In the formula, , Represent the minimum and maximum values ​​in the width i and height j directions respectively. is a very small constant used to prevent the denominator from being zero. X represents the feature map of the input fast average normalization module. X is composed of C⊗R⊗D+I in the brackets in Formula 1. represents the image generated by average pooling of feature map X, and O represents the output result of the fast average normalization module. Since the fast average normalization module is the last part of the entire model, O is also the output result of the entire model.

[0077] The channel dynamic range module normalizes, amplifies, and compresses the channel. It adjusts or enhances the information of the channel through the extreme dynamic range and compensation weight. The expression is:

[0078] (5)

[0079] Where I represents the unprocessed underwater image of the input channel dynamic range module, IA represents the feature map obtained by I using average pooling, and the structure of the PBP-D module is:

[0080] Then use formula (6) to get the compensation weight C, which is expressed as:

[0081] (6)

[0082] In the formula, ε c is a positive constant, p represents the exponent of adjusting the single increase of weight C, and the specific value is determined according to the enhancement result. It is recommended to be set to 5 for UIEB and LSUI datasets.

[0083] Specifically, many works mention that the color balance (or white balance) strategy can achieve ideal enhancement results when the degree of degradation of underwater images is low. In contrast, the deep learning-based method is more suitable for enhancing images at high degradation levels. In order to balance the impact of FAN (color balance strategy) and the product of PBP-R and PBP-D (deep learning network) on the enhancement results, this embodiment requires a feature to determine the degree of degradation of the underwater image. Dynamic range (DR) is widely used in photographic analysis images (as shown in Equation 5) and can be used to evaluate the quality of the original underwater image. Generally, severely degraded underwater images should have a smaller dynamic range.

[0084] Specifically, for the framework of this embodiment, this embodiment hopes that when the input image is severely degraded, the product of PBP-R and PBP-D has a greater weight. Therefore, this embodiment designs a compensation weight C, which should have a negative correlation with DR to control the degree of influence of the PBP branch on the final output. Since this embodiment designs C to be directly multiplied by PBP-D and PBP-R, in order to make C always a single increasing positive number under different dynamic ranges to ensure the influence of the learnable parameters on the enhancement results, this embodiment adds a positive constant ε to the equation c .

[0085] In a specific embodiment, the loss function for training the model includes Color Column Loss (local color distribution loss) and SSIM loss (a loss function based on the structural similarity index Structural Similarity Index, SSIM). The calculation process of Color column loss is as follows: Figure 6 As shown, first, the standard image and the generated image are divided into ten intervals and the histograms are extracted. Then, the difference falling into four intervals, 2, 3, 6, and 7, is calculated using formula (7). Where γ is the scaling factor used to adjust the loss ratio, T is the total number of pixels, Ω represents all selected intervals (intervals 2, 3, 6, and 7), and ω is a specific interval in Ω. ω represents the pixels of the generated image that fall into the interval ω. ω represents the pixels of the standard image that fall into ω. εs is a constant that enables the Color column loss to perform back propagation. SSIM loss is shown in formula (8). The total loss is shown in formula (9). In this embodiment, λ 1 Set to 1, λ 2 Set to 0.1.

[0086] (7)

[0087] Among them, L Color colum represents the Color colum loss function, γ is the scaling factor used to adjust the loss ratio, T is the total number of pixels, Ω represents all selected intervals (intervals 2, 3, 6, 7), and ω is a specific interval in Ω. ω represents the pixels of the generated image that fall into the interval ω. ω represents the pixels of the standard image that fall into ω. s Is a constant that enables Color column loss to perform back propagation.

[0088] (8)

[0089] Among them, L SSIM represents the SSIM loss function, x i is the pixel point in the unprocessed image, y i Represents the pixel point of the processed image, SSIM() means calculating the structural similarity at a certain point, and N represents the total number of pixels.

[0090] (9)

[0091] Among them, λ 1 ,λ 2 Represent the weights of Color column loss and SSIM loss respectively.

[0092] Specifically, due to the uncertainty of pixel-level differences (see Figure 6 Due to the fluctuation of color distribution in (a), neural networks tend to choose neutral colors to generate under-enhanced results, which may lead to insufficient saturation. To solve this problem, this embodiment proposes color column loss, which can compare the local color distribution similarity within a set range between the ground truth image and the generated image. Color column loss uses local intervals to help the model overcome the side effects of fluctuating color distribution. Based on the observation of this embodiment on the UIEB dataset (Li et al., 2019), this embodiment found that when the image tends to gray, there is a maximum difference between the pixels falling into intervals 2, 3, 6, and 7 between the standard image and the enhanced image ( Figure 6 Therefore, this embodiment only calculates the differences between intervals 2, 3, 6, and 7 to solve the undersaturation problem.

[0093] On the other hand, an embodiment of the present invention discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a deep learning-based underwater image enhancement method is implemented.

[0094] Specifically, the underwater image enhancement method and electronic device based on deep learning disclosed in the present invention can achieve the following beneficial effects:

[0095] 1. This method is used to achieve real-time processing of 4K underwater image enhancement tasks on a variety of edge devices.

[0096] 2. Improve the robustness of the enhancement results when there are too bright or too dark areas in the underwater images.

[0097] 3. Achieve high enhancement performance while taking into account high inference speed.

[0098] 4. Improve training results and increase the accuracy of enhancement results in saturation.

[0099] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device 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 method part.

[0100] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for underwater image enhancement based on deep learning, characterized in that: The following steps are involved: Get underwater image enhancement dataset; Constructing an underwater image enhancement model, and using the underwater image enhancement dataset to train the underwater image enhancement model and obtain a training model weight; The training model weights are optimized with mixed precision using the high-performance neural network inference engine TensorRT to obtain an optimized underwater image enhancement model; The optimized underwater image enhancement model is imported into the underwater robot, and the underwater image acquired by the underwater robot is input into the optimized underwater image enhancement model to obtain an enhanced underwater image and output it; The underwater image enhancement model includes the following four parts: A fast average normalization module, a channel dynamic range module, a PBP-D module and a PBP-R module, through which data preprocessing, feature extraction and image reconstruction tasks are completed; The channel dynamic range module normalizes, amplifies, and compresses the channel, and adjusts or enhances the information of the channel through the extreme dynamic range and compensation weight. The expression is: DR=max i,j (I A (i,j))-min i,j (I A (i,j)) Where I represents the unprocessed underwater image of the input channel dynamic range module, I A Represents the feature map obtained by using average pooling; Then use the following formula to get the compensation weight C, which is expressed as: C=(1-DR) p +e c In the formula, ε c is a positive constant, p represents the exponent of the single increase of the adjustment weight C, The structure of the PBP-D module includes: a pixelunshuffle module and an anti-bottleneck module, wherein the anti-bottleneck module is composed of two convolutional layers; The input image first passes through the pixelunshuffle module for pixelunshuffle operation, and then passes through the anti-bottleneck module composed of two convolutional layers to activate the feature map. The feature map processed by the anti-bottleneck module is restored to the size of the original input underwater image through the pixelshuffle module to obtain the final output result; The structure of the PBP-R module includes: a pixelunshuffle module and an anti-bottleneck module, wherein the anti-bottleneck module is composed of two convolutional layers; The input image first passes through the pixelunshuffle module for pixelunshuffle operation, and then passes through the anti-bottleneck module composed of two convolutional layers to activate the feature map. The feature map processed by the anti-bottleneck module is restored to the size of the original input underwater image through the pixelshuffle module to obtain the final output result; In the formula, min i,j (), max i,j () represent the minimum and maximum values ​​in the width i and height j directions respectively, ε n is a very small constant used to prevent the denominator from being zero. X represents the feature map of the input fast average normalization module. X A represents the image generated by average pooling of feature map X, and O represents the output result of the fast average normalization module. Since the fast average normalization module is the last part of the entire model, O is also the output result of the entire model.

2. The underwater image enhancement method based on deep learning according to claim 1, characterized in that: The convolution kernel size of the convolution layer in the PBP-D module is 1*1.

3. The underwater image enhancement method based on deep learning according to claim 2, characterized in that: The expression of the activation function in the PBP-D module is: f ta (x)=|tanh(x)|; In the formula, tanh() means using the tanh activation function, || means taking the absolute value, and x means the input of the activation function.

4. The underwater image enhancement method based on deep learning according to claim 1, characterized in that: The convolution kernel size of the convolution layer of the PBP-R module is 3*3.

5. The method for underwater image enhancement based on deep learning according to claim 4, characterized in that: The expression of the activation function in the PBP-R module is: f tr (x)=max(0,tanh(x); In the formula, tanh() means using the tanh activation function, max(0, tanh()) means selecting a larger value between tanh() and 0, and x means the input of the activation function.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the deep learning-based underwater image enhancement method as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Image quality enhancement method based on channel attention mechanism

    CN113160198A

  • Underwater image enhancement method based on RGB channel recovery

    CN116167941A