A multi-stage progressive underwater image enhancement method

By employing a multi-stage progressive underwater image enhancement method, utilizing the Transformer framework MSTUIE model and combining TGF blocks and SSK blocks, the problem of poor performance of traditional underwater image enhancement models in complex underwater scenes is solved, achieving global feature extraction and image quality improvement.

CN114445292BActive Publication Date: 2025-10-21CHINA AGRI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210052263.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-18
Publication Date
2025-10-21
Estimated Expiration
2042-01-18

AI Technical Summary

Technical Problem

Traditional underwater image enhancement models perform poorly in complex and varied underwater scenes, and CNN-based multi-scale methods have limitations in global feature acquisition, making it difficult to effectively improve the quality of underwater images.

Method used

A multi-stage progressive underwater image enhancement method is adopted, using the Transformer structure framework MSTUIE model, combined with TGF blocks and SSK blocks, to extract global features through the self-attention mechanism, and reduce the multi-head attention computation cost through the mixing layer. The selective supervision kernel convolution block realizes information transfer between different scales, and introduces multiple loss function optimization models.

Benefits of technology

It improves the effectiveness and robustness of underwater image restoration and enhancement, enhances image quality and global feature extraction capabilities, and adapts to different underwater environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114445292B_ABST
    Figure CN114445292B_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-stage progressive underwater image enhancement methods belonging to image processing technical field, the method is based on the good effect and advantage that MSTUIE model in the computer vision of identification, detection, segmentation and image processing based on Transform structure framework is shown;Using self-attention mechanism, the degraded underwater image is enhanced and reconstructed, TGF block is designed to extract global features, meet the dependence demand of global feature information for various tasks, and solve the position sensitivity in underwater image enhancement task, reduce the calculation cost of multi-head attention, explore different scale feature information, select supervision kernel convolution block SSK to realize information transmission between different scales, use dynamic selection kernel to save spatial feature map, and supervise attention mechanism to guide image generator to reconstruct image;The effectiveness and robustness of image restoration of MSTUIE in different underwater environments are verified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and in particular relates to a multi-stage progressive underwater image enhancement method. Background Art

[0002] Over the past few decades, with the growing demand for marine resources and computer vision, high-quality and clear underwater imagery has become crucial for the perception and understanding of underwater scenes. Underwater image enhancement can significantly improve the quality of degraded underwater images. Underwater images are affected by the water environment, light absorption, and scattering, resulting in blue or green casts, chromatic aberration, and image degradation, which complicate various underwater tasks. Therefore, an effective underwater image enhancement model is urgently needed to optimize and improve the quality of underwater images.

[0003] Traditional underwater image enhancement models mostly rely on physical models or special optical models to estimate medium transmission parameters and underwater image prior information to improve the quality of degraded images and achieve the effect of restoration and reconstruction. However, traditional methods rely too much on the characteristics of the model itself during the restoration process. The restoration process requires a large amount of underwater prior knowledge, and the results are poor when faced with complex and changing underwater scenes. In recent years, with the rapid development and application of deep learning models, convolutional neural networks (CNNs) can better fit massive data information and show good interpretability in various visual tasks. The characteristics of CNN can better help underwater enhancement models improve the quality of degraded images. Data-driven image enhancement models are mostly designed based on single-stage objective optimization, but multi-stage networks have better results in low-level image processing, such as enhancement, reconstruction, dehazing and rain removal. Although CNN-based multi-scale methods have excellent representation capabilities, they usually show certain limitations in obtaining global image features during the modeling process;

[0004] The Transformer has recently demonstrated promising results and advantages in many computer vision tasks, such as recognition, detection, segmentation, and image processing. This architecture leverages a self-attention mechanism to address the global feature information required by various tasks. This paper, taking into account the Transformer's global feature representation capabilities and good interpretability, further improves and optimizes it, introducing it to underwater image restoration and enhancement, achieving promising results.

[0005] Among them, the underwater image enhancement task is more sensitive to the position information of the degraded image and the reconstructed image. Therefore, we propose a new multi-scale Transformer structure framework (MSTUIE) to enhance underwater images. First, we introduce a multi-scale structure to gradually enhance underwater images. Second, we design a TGF block to extract global features and solve the position sensitivity problem in the underwater image enhancement task. The core design of TGF is to apply a mixing layer to reduce the computational cost of multi-head attention, which makes TGF suitable for capturing more global dependencies. In order to explore feature information at different scales, we propose a selectively supervised kernel convolution block (SSK) to realize information transfer between different scales. SSK uses dynamically selected kernels to preserve spatial feature maps, and the supervised attention mechanism can guide the image generator to reconstruct the image. Finally, we verify the effectiveness and robustness of MSTUIE in image restoration in different underwater environments. Summary of the Invention

[0006] The purpose of the present invention is to provide a multi-stage progressive underwater image enhancement method, characterized in that the method is based on the Transformer structure framework, namely the MSTUIE model, which has shown good effects and advantages in many computer vision tasks, including recognition, detection, segmentation and image processing; using the self-attention mechanism to enhance and reconstruct underwater degraded images, designing TGF blocks to extract global features, meeting the dependence requirements of various tasks on global feature TGF information, and solving the position sensitivity in underwater image enhancement tasks. The core design of TGF is to apply a mixing layer to reduce the computational cost of multi-head attention. In order to explore feature information of different scales, the selective supervision kernel convolution block SSK realizes information transfer between different scales, uses dynamic selection kernels to save spatial feature maps, and supervises the attention mechanism to guide the image generator to reconstruct the image; finally, we verify the effectiveness and robustness of MSTUIE in image restoration in different underwater environments. The underwater image enhancement method includes the following steps:

[0007] 1) Construct training and test sets using public and self-built underwater image datasets;

[0008] 2) Perform image preprocessing, randomly crop the training image to 128*128, and normalize the pixel values ​​to [-1,1];

[0009] 3) Using the multi-scale Transformer structure framework MSTUIE to obtain the global feature information of the original underwater image;

[0010] 4) Using the global feature extraction model TGF to obtain the global dependency of underwater images;

[0011] 5) Using the selected supervision kernel convolution block SSK between different scales to fuse multi-scale image feature information, reduce the loss of information transmission, and improve the quality of image reconstruction;

[0012] 6) Global model optimization and parameter adjustment: optimize and train the three-scale feature extraction networks simultaneously to achieve the global optimal effect, and introduce an unsupervised loss function for optimization to increase the adaptability of the model;

[0013] 7) Use the trained model to test the test data set to verify the effectiveness of the model.

[0014] The underwater public image dataset and the self-built underwater image dataset of step 1) are divided into training dataset and test dataset to train and tune the MSTUIE model, and the four public datasets of UGAN, EUVP`, UIEB and Jerlov are selected for preprocessing, among which the EUVP dataset contains three sub-datasets Dark, ImageNet and Scenes; and the preprocessed data are statistically analyzed. The step 3) uses the multi-scale Transformer structure framework to learn global feature information from the original underwater image, and combines the encoder and decoder to repair and reconstruct the degraded image, and divides the input image size H×W×C into the first layer. Image scale blocks are used to facilitate the subsequent Transformer structure processing and extract the global feature information of the image; the image scale blocks of the second layer are The image scale blocks of the third layer are H×W, where H and W are the height and width of the image respectively; C is the number of channels of the image. Figure 2 (b) is used to capture global correlations and improve global feature extraction. UNet captures detailed texture content and perceptual features by encoding each patch in the TGF. The third layer utilizes ORSNet to preserve spatial details and content information in the final output image. To preserve spatial features, we design a selectively supervised kernel convolution block (SSK) and utilize cross-stage feature fusion (CSFF) for feature transition and information preservation. The SSK block can fuse features across different scales, minimizing the loss of precise spatial details. Furthermore, it preserves the original ground truth features for significant performance gains.

[0015] The global feature extraction model TGF constructs a hybrid layer and a multi-head attention module to form a Transformer encoder. Each TGF contains a standard layer, a hybrid layer, a multi-head attention module and a position feedforward network FFN. In order to balance the capacity and computational requirements, the feature resolution of each TGF is set to the same size as the input, where the input image features are expressed as Representation; Divide the input feature map into n×n image blocks and flatten each image block into a squeeze variable to facilitate TGF processing;

[0016] The Transformer encoder is similar to the traditional Transformer encoder. The TGF model adopts a hybrid attention mechanism, which uses a hybrid layer to reduce the computational cost of the multi-head self-attention mechanism, randomly masks the feature sequence (q, k, v) of the input image, and outputs a new feature sequence (q′, k′, v′). The hybrid layer ML can better increase the robustness and effectiveness of feature extraction. The global feature extraction model is expressed as:

[0017] X TGF =TGF(q,k,v)=Concat(head1,...,head h )W o (1)

[0018] q′,k′,v′=ML(q,k,v) (2)

[0019] head i =Attention(q′W i q′ , k′W i k′ , v′W i v′ ) (3)

[0020] where i∈d k , and are the parameters and weights of the linear projection function; h represents the number of heads encoded by the Transformer; the head size dimension of each module is d k , where d v equal The attention mechanism is the same as the ordinary Transformer mechanism, and the operation process is:

[0021]

[0022] Finally, the layer norm and FFN are used to calculate the sliding local feature information of the previous layer; the FFN layer calculation process is as follows:

[0023] FFN(x)=max(0,xW1+b1)W2+b2 (5)

[0024] Where W1 and W2 are learnable weight matrices, b1 and b2 are biases; the improved TGF encoder has almost no increase in the number of parameters compared to the traditional Transformer encoder, and can effectively learn various features from different datasets and scales;

[0025] Finally, the ablation experiment further shows that TGF is a robust global feature extraction model that can better improve the multi-scale Transformer structure framework and repair degraded underwater image information.

[0026] The described combination of encoder and decoder performs restoration and reconstruction of degraded images. The image feature reconstruction process of the UNet network and decoder is to convert the image matrix features into sequence vectors, which can better restore the detailed texture information of the image through the global features of the image.

[0027] The global feature extraction model TGF improves and optimizes the features of the traditional Transformer model and introduces a hybrid mask layer to improve the robustness and effectiveness of the model.

[0028] To ensure the effectiveness of information transfer between different scales, a selective supervision convolution kernel block (SSK) is designed to preserve the feature information of multi-scale space. (The schematic diagram of the SSK module is shown in the figure.) Figure 3 As shown in the figure, the SSK module allows feature information to pass through and adjusts the receptive field size of the convolution kernel to adapt to the multi-scale feature network. SSK obtains feature information at two different scales. and the original image Among them, the Transformer and It is a selective kernel unit with convolution kernel size 3 and 5. This selective kernel unit consists of grouped convolution, batch normalization and RELU function. The output characteristics are: We use the elements and to express the two-branch integration process as follows:

[0029]

[0030] SSK uses a global average pooling layer Calculating channel statistics We compute s by shrinking U in the spatial dimension, and then fully connecting the layers The dimension can be reduced to z∈R d×1 This compact feature computation process can adaptively calibrate multi-scale feature maps. The computation process is:

[0031]

[0032]

[0033] where s c The c-th element s represented by . is the weight coefficient.

[0034] The soft attention mechanism can select spatial feature maps of different scales. Then, we concatenate the two scale feature maps and output the attention weights Self-supervised attention mechanism can predict enhanced images Reduce the propagation of useless information to the next scale network. Process the input feature map through the 1×1 convolution layer to obtain the predicted feature map F in The predicted feature map is then added to the degraded underwater image to obtain the enhanced image We also use a 1×1 convolutional layer and a Sigmoid activation function to obtain the mask weight for each pixel. Among them, M can effectively guide the attention weight matrix to produce a clear feature image V. The final output feature F out is the result of the additive operation of the input features and the attention feature map. The SSK calculation process can be expressed as:

[0035] F out =F in +V×M (9)

[0036] The selectively supervised convolution kernel module SSK introduces an adaptive feature selection mechanism, which can effectively guide the convolution kernel to perform feature selection and adapt the input information to different feature scales; the image attention mask M mechanism is introduced to reduce the impact of useless information on the feature image of the next stage with the help of supervised feature selection, thereby improving the efficiency of information reconstruction.

[0037] In the process of global model optimization and parameter adjustment, multiple supervised and unsupervised loss functions are introduced to improve the optimization effect and efficiency of the model, including charbonnier loss, edge loss, content loss, perceptual loss, adversarial loss, total variance, loss and dark channel loss.

[0038] The framework objective loss function is as follows:

[0039]

[0040] where λ e ,λ r ,λ a ,λ p ,λ t and λ d is the trade-off weight coefficient.

[0041] The charbonnier loss is defined as:

[0042]

[0043] Y stands for clear image, E Srepresents the generated image. The constant ε is set to 10 based on experience. -3 .

[0044] Marginal loss function Defined as:

[0045]

[0046] Where Δ is the Laplace operator.

[0047] The reconstruction loss can reduce the difference between the generated image and the clear image and is defined as:

[0048]

[0049] Adversarial loss can make network training more stable and have better performance. The adversarial loss formula is:

[0050]

[0051] Perceptual loss preserves perceptual features and improves the visual quality of the result. It can measure the height difference between the generated image and the clear image. i (x) is regarded as a perceptual feature, and the feature information of the activation layer i of the VGG network is extracted and defined as:

[0052]

[0053] It uses the total variance loss function and dark channel loss function in the unsupervised process to further optimize the enhanced network; the total variance loss is a normalization function that can improve spatial smoothness and reduce noise. It is defined as follows:

[0054]

[0055] and Represents horizontal and vertical gradient operators;

[0056] In addition, the dark channel loss function can effectively ensure the consistency between the enhanced image in the dark channel and the real image. The formula is as follows:

[0057]

[0058] Where X represents the input image, represents the dark channel of the image, N(X) is the local feature block centered on a single pixel, and the size of each module is set to 13*13.

[0059] The beneficial effect of the present invention is that the present invention takes into account the global feature representation ability and good interpretability of Transformer, and through further improvement and optimization, introduces it into underwater scenes for image restoration and enhancement, and achieves good results. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 Multi-scale Transformer structure framework MSTUIE architecture

[0061] Figure 2 (a) General Transformer encoder block; (b) Global feature extraction model (TGF)

[0062] Figure 3 To select the supervisory kernel convolution block (SSK)

[0063] Figure 4 Qualitative performance comparison for EUVP underwater dataset scenes DETAILED DESCRIPTION

[0064] This paper proposes a multi-stage progressive underwater image enhancement method based on the Transformer architecture, the MSTUIE model, which has demonstrated excellent results and advantages in many computer vision tasks, including recognition, detection, segmentation, and image processing. It utilizes a self-attention mechanism to enhance and reconstruct degraded underwater images. The TGF blocks are designed to extract global features, meeting the reliance of various tasks on global feature TGF information and addressing the position sensitivity of underwater image enhancement tasks. The core design of the TGF is to apply a mixing layer to reduce the computational cost of the multi-head attention module. To explore feature information at different scales, the selectively supervised kernel (SSK) convolution block enables information transfer between scales. Dynamically selected kernels are used to preserve spatial feature maps, and the supervised attention mechanism guides the image generator to reconstruct images. Finally, we verify the effectiveness and robustness of MSTUIE in image restoration in different underwater environments. The present invention is further described below with reference to the accompanying figures.

[0065] The underwater image enhancement method comprises the following steps:

[0066] 1) Construct training and test sets using public and self-built underwater image datasets;

[0067] 2) Perform image preprocessing, randomly crop the training image to 128*128, and normalize the pixel values ​​to [-1,1];

[0068] 3) Using the multi-scale Transformer structure framework MSTUIE to obtain the global feature information of the original underwater image;

[0069] 4) Using the global feature extraction model TGF to obtain the global dependency of underwater images;

[0070] 5) Using the selected supervision kernel convolution block SSK between different scales to fuse multi-scale image feature information, reduce the loss of information transmission, and improve the quality of image reconstruction;

[0071] 6) Global model optimization and parameter adjustment: optimize and train the three-scale feature extraction networks simultaneously to achieve the global optimal effect, and introduce an unsupervised loss function for optimization to increase the adaptability of the model;

[0072] 7) Use the trained model to test the test data set to verify the effectiveness of the model.

[0073] The underwater public image dataset and the self-built underwater image dataset in step 1) are divided into training dataset and test dataset to train and tune the MSTUIE model. The four public datasets of UGAN, EUVP, UIEB and Jerlov are selected for preprocessing, among which the EUVP dataset contains three sub-datasets: Dark, ImageNet and Scenes. Figure 4 As shown; and the pre-processed data are statistically analyzed (as shown in Table 1): In order to make a fair comparison, we selected four public datasets to evaluate our proposed method.

[0074] Table 1 Statistics of each data set

[0075]

[0076] Step 3) uses a multi-scale Transformer structure framework (such as Figure 1 As shown in Figure 2, (MSTUIE) learns global feature information from the original underwater image and combines the encoder and decoder to repair and reconstruct the degraded image. The input image size is divided into H×W×C, and the first layer is divided into Image scale blocks are used to facilitate the subsequent Transformer structure processing and extract the global feature information of the image; the image scale blocks of the second layer are The image scale blocks of the third layer are H×W, where H and W are the height and width of the image respectively; C is the number of channels of the image. Figure 2 (b) is used to capture global correlation and improve global feature extraction; UNet captures detailed texture content and perceptual features by encoding each patch in TGF (as shown in Figure 1 shown).

[0077] The global feature extraction model TGF constructs a hybrid layer and a multi-head attention module to form a Transformer encoder. Each TGF contains a standard layer, a hybrid layer, a multi-head attention module and a position feedforward network FFN. In order to balance the capacity and computational requirements, the feature resolution of each TGF is set to the same size as the input, where the input image features are expressed as Representation; Divide the input feature map into n×n image blocks and flatten each image block into a squeeze variable to facilitate TGF processing; (for example, we take the first scale feature For example, TGF will process n 2 image blocks.)

[0078] and Figure 2 Similar to the traditional Transformer encoder shown in (a), the TGF model adopts a hybrid attention mechanism, which uses a hybrid layer to reduce the computational cost of the multi-head self-attention module, randomly masks the feature sequence (q, k, v) of the input image, and outputs a new feature sequence (q′, k′, v′); the hybrid layer ML can better increase the robustness and effectiveness of feature extraction; the global feature extraction model is expressed as:

[0079] X TGF =TGF(q,k,v)=Concat(head1,...,head h )W o (1)

[0080] q′,k′,v′=ML(q,k,v) (2)

[0081] head i =Attention(q′W i q′ , k′W i k′ , v′W i v′ ) (3)

[0082] where i∈d k , and are the parameters and weights of the linear projection function; h represents the number of heads encoded by the Transformer; the head size dimension of each module is d k , where d v Equal to d h / h; The attention mechanism used here is the same as the sub-attention mechanism in the ordinary Transformer, and its operation process is:

[0083]

[0084] The third layer utilizes ORSNet to preserve spatial details and content information in the final output image. To preserve spatial features, we design a selectively supervised kernel convolution block (SSK block) and utilize cross-stage feature fusion (CSFF) for feature transition and information preservation. The SSK block can fuse features across different scales, minimizing the loss of precise spatial details. Furthermore, it maintains the original ground truth features for significant performance gains.

[0085] Finally, the FFN layer is used for regularization and forward operation. The FFN layer can calculate the sliding feature information and global information of the previous layer. The calculation process of FFN is:

[0086] FFN(x)=max(0,xW1+b1)W2+b2 (5)

[0087] Where W1 and W2 are learnable weight matrices, and b1 and b2 are bias terms. The improved TGF encoder has almost no increase in parameters compared to the traditional Transformer encoder and can effectively learn various features from different datasets and scales.

[0088] Finally, the ablation experiment further shows that TGF has good robustness and can better extract the global feature position information of the image, thereby further improving the quality of image restoration.

[0089] The model described in this paper combines a Transformer encoder and decoder to perform restoration and reconstruction of underwater degraded images. The decoder uses a UNet network as the basis for feature reconstruction of the input image and further converts the image matrix features into a sequence vector to improve the model's ability to obtain global and positional information during the feature extraction process.

[0090] The global feature extraction model TGF improves and optimizes the features of the traditional Transformer model and introduces a hybrid mask layer to improve the robustness and effectiveness of the model.

[0091] To ensure the effectiveness of information transfer between different scales, a selective supervision convolution kernel block (SSK) is designed to preserve the feature information of multi-scale space. (The schematic diagram of the SSK module is shown in the figure.) Figure 3 As shown in the figure, the SSK module allows feature information to pass through and adjusts the receptive field size of the convolution kernel to adapt to the multi-scale feature network. SSK obtains feature information at two different scales. and the original image Among them, the Transformer and It is a selective kernel unit with convolution kernel size 3 and 5. This selective kernel unit consists of grouped convolution, batch normalization and RELU function. The output characteristics are: We use the elements and to express the two-branch integration process as follows:

[0092]

[0093] SSK uses a global average pooling layer Calculating channel statistics We compute s by shrinking U in the spatial dimension, and then fully connecting the layers The dimension can be reduced to z∈R d×1 This compact feature computation process can adaptively calibrate multi-scale feature maps. The computation process is:

[0094]

[0095]

[0096] Among them, s c The c-th element s represented by . is the weight coefficient.

[0097] The soft attention mechanism selects spatial feature weights at different scales for the input image. We then concatenate the two scale feature maps and output the attention weights Self-supervised attention mechanism can predict enhanced images Reduce the propagation of useless information to the next scale network. Process the input feature map through the 1×1 convolution layer to obtain the predicted feature map F in The predicted feature map is then added to the degraded underwater image to obtain the enhanced image We also utilize a 1×1 convolutional layer with a Sigmoid activation function to obtain the attention mask for each pixel. The mask M can effectively guide the attention weight matrix to produce a clear feature image V. The final output feature F out is the result of the additive operation of the input features and the attention feature map. The SSK calculation process can be expressed as:

[0098] F out =F in +V×M (9)

[0099] The selectively supervised convolution kernel module SSK introduces an adaptive feature selection mechanism, which can effectively guide the convolution kernel to perform feature selection and adapt the input information to different feature scales; the image attention mask M mechanism is introduced to reduce the impact of useless information on the feature image of the next stage with the help of supervised feature selection, thereby improving the efficiency of information reconstruction.

[0100] During the global model optimization and parameter adjustment process, multiple supervised and unsupervised loss functions are introduced to improve the optimization effect and efficiency of the model, including charbonnier loss, edge loss, content loss, perceptual loss, adversarial loss, total variance loss, and dark channel loss. The framework objective loss function is as follows:

[0101]

[0102] where λ e ,λ r ,λ a ,λ p ,λ t and λ d is the trade-off weight coefficient.

[0103] The charbonnier loss is defined as:

[0104]

[0105] Y stands for clear image, E S represents the generated image. The constant ε is set to 10 based on experience. -3 .

[0106] Marginal loss function Defined as:

[0107]

[0108] Where Δ is the Laplace operator.

[0109] The reconstruction loss can reduce the difference between the generated image and the clear image and is defined as:

[0110]

[0111] Adversarial loss can make network training more stable and have better performance. The adversarial loss formula is:

[0112]

[0113] Perceptual loss preserves perceptual features and improves the visual quality of the result. It can measure the height difference between the generated image and the clear image. i (x) is regarded as a perceptual feature, and the feature information of the activation layer i of the VGG network is extracted and defined as:

[0114]

[0115] It uses the total variance loss function and dark channel loss function in the unsupervised process to further optimize the enhanced network; the total variance loss is a normalization function that can improve spatial smoothness and reduce noise. It is defined as follows:

[0116]

[0117] and Represents horizontal and vertical gradient operators;

[0118] In addition, the dark channel loss function can effectively ensure the consistency between the enhanced image in the dark channel and the real image. The formula is as follows:

[0119]

[0120] Where X represents the input image, represents the dark channel of the image, N(X) is the local feature block centered on a single pixel, and the size of each module is set to 13*13.

[0121] We implemented the MSTUIE model in the PyTorch framework platform on two computers with NVIDIA Tesla V100 GPU graphics cards. The MSTUIE model is a multi-scale end-to-end network. We trained the model with 1×10 5 We further apply horizontal flipping and vertical flipping to perform data augmentation by cropping the image to 128×128. We use Adam to optimize the network and set the initial learning rate to 2×10 -5 , and then decreased to 1×10 -7 In order to make the objective function closer to the optimal global value, we use cosine annealing to reduce the learning rate. The parameter information of the loss function of the MSTUIE framework is set to e 5× 10 -2 λ r ,λ p ,λ d is 10 -2 ,λ a and λ t is 10 -2 .

Claims

1. A multi-stage progressive underwater image enhancement method, characterized in that: The underwater image enhancement method comprises the following steps: 1) Construct training and test sets using public and self-built underwater image datasets; 2) Perform image preprocessing, randomly crop the training image to 128*128, and normalize the pixel values ​​to [-1,1]; 3) Using the multi-scale Transformer structure framework to learn global feature information from the original underwater image, and combining the encoder and decoder to repair and reconstruct the degraded image, the input image size is divided into H×W×C, and the first layer is divided into Image scale blocks and extract global feature information of the image; The image scale block of the second layer is The image scale blocks of the third layer are H×W, where H and W are the height and width of the image respectively; C is the number of channels of the image; 4) Designing a TGF block to extract global features at each layer is used to capture global feature correlations. By encoding each patch in the TGF, it captures detailed texture content and perceptual features and improves global feature extraction. Each TGF consists of a standard layer, a hybrid layer, a multi-head attention module, and a position feed-forward network (FFN). 5) Use selective supervision kernel convolution block SSK between different scales to fuse multi-scale image feature information, reduce the loss of information transmission, and improve the quality of image reconstruction; 6) Global model optimization and parameter adjustment, while optimizing and training the three scale feature extraction networks to achieve the global optimal effect, and introducing unsupervised and supervised loss functions for optimization to increase the adaptability of the model; 7) Use the trained model to test the test data set to verify the effectiveness of the model.

2. The multi-stage progressive underwater image enhancement method according to claim 1, characterized in that: The public underwater image dataset and the self-built underwater image dataset in step 1) are divided into a training dataset and a test dataset, and four public datasets, UGAN, EUVP, UIEB, and Jerlov, are selected for preprocessing, and statistics are performed on the preprocessed data; The EUVP dataset contains three sub-datasets: Dark, ImageNet, and Scenes.

3. The multi-stage progressive underwater image enhancement method according to claim 1, characterized in that: The TGF block adopts a hybrid attention mechanism, which uses a hybrid layer to reduce the computational cost of the multi-head self-attention module, randomly masks the feature sequence (q, k, v) of the input image and outputs a new feature sequence (q′, k′, v′); the hybrid layer ML increases the robustness and effectiveness of feature extraction; the global feature extraction model is expressed as: X TGF =TGF(q,k,v) (1) =Concat(head1,…,head h )W o q′,k′,v′=ML(q,k,v) (2) head i =Attention(q′W i q′ ,k′W i k′ ,v′w i v′ ) (3) where i∈d k , and are the parameters and weights of the linear projection function; h represents the number of heads encoded by the Transformer; the head size dimension of each module is d k , where d v equal The operation process of the hybrid attention mechanism is: Finally, the layer norm and FFN are used to calculate the sliding local feature information of the previous layer; the FFN calculation process is as follows: FFN(x)=max(0,xW1+b1)W2+b2 (5) Where W1 and W2 are learnable weight matrices, and b1 and b2 are biases.

4. The multi-stage progressive underwater image enhancement method according to claim 2, characterized in that: The selective supervision kernel convolution block SSK is designed to preserve the feature information of multi-scale space and the effectiveness of information transmission between different scales; SSK allows feature information to pass through and adjusts the receptive field size of the convolution kernel to adapt to the multi-scale feature network. SSK obtains two input feature images of different scales Among them, the Transformer and It is a selective kernel unit with convolution kernel size 3 and 5; this selective kernel unit consists of grouped convolution, batch normalization and RELU function; its output characteristics are: The process of integrating the two branches using elements and is expressed as follows: SSK uses a global average pooling layer Calculating channel statistics , compute s by shrinking U in the spatial dimension, and then fully connected layer Reduce the dimension to z∈R d×1 , adaptively calibrate the multi-scale feature map, and the calculation process is: where s c represents the cth element of s, is the weight coefficient.

5. The multi-stage progressive underwater image enhancement method according to claim 1, characterized in that: The self-attention mechanism is used to enhance and reconstruct the original underwater degraded image. The self-attention mechanism selects spatial feature maps of different scales, then connects the two scale feature maps and outputs the attention weight. The input feature map is processed by a 1×1 convolutional layer to obtain a predicted feature map; the predicted feature map is then added to the original underwater degraded image to obtain an enhanced image A 1×1 convolutional layer and a Sigmoid activation function are also used to obtain the attention mask for each pixel. The SSK calculation process is expressed as: F out =F in +V×M (9)。 6. The multi-stage progressive underwater image enhancement method according to claim 1, characterized in that: In step 6), multiple supervised and unsupervised loss functions are introduced in the process of global model optimization and parameter adjustment to improve the optimization effect and efficiency of the model, including charbonnier loss, edge loss, content loss, perceptual loss, adversarial loss, total variance loss and dark channel loss; the framework objective loss function is as follows: where λ e ,λ r ,λ a ,λ p ,λ t and λ d is the trade-off weight coefficient; The charbonnier loss is defined as: Y stands for clear image, E S represents the generated image, and the constant ε is set to 10 based on experience -3 , Marginal loss function Defined as: Where Δ is the Laplace operator; The reconstruction loss reduces the difference between the generated image and the clean image and is defined as: Adversarial loss makes network training more stable and has better performance. The adversarial loss formula is: The perceptual loss preserves perceptual features and improves the visual quality of the results; it measures the height difference between the generated image and the clear image; φ i (x) is regarded as a perceptual feature, and the feature information of the activation layer i of the VGG network is extracted and defined as: It uses the total variance loss function and dark channel loss function in the unsupervised process to further optimize the enhanced network; The total variance loss is a normalization function that improves spatial smoothness and reduces noise; it is defined as follows: and Represents horizontal and vertical gradient operators; In addition, the dark channel loss function effectively ensures the consistency between the enhanced image in the dark channel and the real image. The formula is as follows: Where X represents the input image, represents the dark channel of the image, N(X) is the local feature block centered on a single pixel; each module is set to a size of 13×13.

Citation Information

Patent Citations

  • Artificial intelligence is robot independently under water

    CN207408808U

  • Pilot display systems and methods

    US20170227639A1