A lightweight underwater image enhancement method based on skip-sampling diffusion model

By employing a skip sampling diffusion model and an attention-driven Transformer module, the problems of color distortion and scattering blur in underwater images are solved, achieving efficient underwater image enhancement suitable for real-time vision systems of autonomous underwater vehicles.

CN119887552BActive Publication Date: 2025-11-21HANGZHOU DIANZI UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411861887.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-11-21
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively address color distortion and scattering blur in underwater images, especially in the vision systems of autonomous underwater vehicles (AUVs). Traditional methods suffer from high computational complexity and are insufficient for real-time processing requirements, while convolutional neural network-based methods have limitations in color correction and detail restoration.

Method used

A lightweight underwater image enhancement method based on a step sampling diffusion model is adopted. An attention-driven Transformer module is designed to achieve parallel processing of temporal step encoding and color information. A spatial attention mechanism is introduced to enhance the detail recovery capability, and a global channel interaction module is used to maintain color fidelity.

Benefits of technology

It significantly improves the modeling and detail recovery capabilities of underwater images, reduces the number of model parameters, and enhances inference speed and real-time processing capabilities. The experimental results are excellent on public datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887552B_ABST
    Figure CN119887552B_ABST
Patent Text Reader

Abstract

The application discloses a kind of light-weight underwater image enhancement methods based on skip sampling diffusion model, which realizes the independent parallel processing of time step coding and color information by designing the parallel structure of attention-driven Transform (AP-Trans) module, while introducing spatial attention mechanism to enhance the detail recovery capability, and using global channel interaction module to maintain color fidelity, realizing the high-quality enhancement of underwater image, further by replacing the large parameter self-attention module in traditional diffusion model with lightweight channel attention mechanism, the model parameter quantity is significantly reduced, and a dynamic skip sampling strategy is used to reduce the 20-50 step sampling process of traditional skip diffusion model to 5 steps, the method of the application not only significantly improves the enhancement effect while maintaining the excellent generation ability of diffusion model, but also effectively solves the interaction interference problem of time step coding and color information, and balances the recovery of underwater image color and detail.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer vision and artificial intelligence, in particular to underwater image quality enhancement technology, and specifically to a lightweight underwater image enhancement method based on a skip sampling diffusion model. BACKGROUND

[0002] With the deepening of ocean exploration, underwater autonomous vehicles (AUVs) play an increasingly important role in the fields of ocean resource development and environmental monitoring; however, the underwater environment poses significant challenges to the vision system of AUVs, mainly due to two optical degradation effects: (1) color distortion caused by selective absorption of different wavelengths of light underwater, usually manifested as blue or green tint; (2) image blurring and reduced detail visibility caused by scattering of light by suspended particles, which severely affect underwater image quality, including contrast and clarity, limiting the application scenarios of AUVs.

[0003] To address the above optical degradation effects, traditional image processing techniques are divided into two categories: physical model-based and non-physical model-based methods, i.e., underwater image enhancement based on physical models and underwater image enhancement based on multi-color space and channel frequency division, but these methods often require specific adjustments for different underwater conditions and have high computational complexity, making it difficult to meet real-time processing requirements. In recent years, deep learning technology has made significant progress in underwater image enhancement, with methods based on convolutional neural networks (CNNs) such as Ucolor and UIECˆ2 showing good potential in color restoration, but these methods mainly focus on color correction and are insufficient in handling blurring effects caused by scattering. In addition, due to the difficulty of obtaining standard images of real underwater scenes, the dependence on training data further limits their performance. Existing systems mainly focus on color correction and contrast stretching, and have not effectively addressed the problem of scattering blurring in underwater images. The DM-water method based on diffusion model has made progress in color restoration, but its Transformer module mainly relies on channel attention mechanisms and lacks a specialized structure to restore blurred details, still having limitations in detail preservation. Therefore, the problems of color distortion and scattering blurring in underwater images need to be addressed. SUMMARY

[0004] The present application aims to provide a lightweight underwater image enhancement method based on a skip sampling diffusion model, which designs an attention-driven Transformer (AP-Trans) module to achieve independent parallel processing of time step encoding and color information, introduces a spatial attention mechanism to enhance detail restoration capability, and uses a global channel interaction module to maintain color fidelity, to address the problem of severe color distortion and detail blurring in acquired images due to the complexity of the underwater environment, selective absorption and scattering of light during propagation.

[0005] To solve the above technical problems, the present application provides the following technical solutions: a lightweight underwater image enhancement method based on a skip sampling diffusion model, which mainly includes two processes of training and reasoning:

[0006] Step S01: The training process is a Markov random process, that is, the result of the next step is only determined by the result of the current step and is irrelevant to the previous step, and a fixed decreasing sequence from large to small is set as the signal preservation coefficient , clear underwater image labels are set as ideal target images ;

[0007] Further, to ensure that the model is not sensitive to the fixed number of steps and to increase the step robustness of the model, a positive integer t is randomly selected from a uniform distribution each time as the number of steps to be learned, according to the Markov chain, the label after adding noise for t steps is:

[0008]

[0009] , wherein is the cumulative product of the predetermined signal preservation coefficient, , that is, the product of all from step 0 to step t; is the input Gaussian noise, is the ideal target image.

[0010] Step S02: input the degraded underwater image raw as a conditional variable , combine the time step t and the corresponding noise-added image to input the diffusion model with a U-shaped network structure, wherein the conditional variable is used to guide the denoising process to ensure that the generated result is consistent with the input image content, and the time step t is used to control the denoising intensity to achieve gradual recovery from noise to clear image;

[0011] Further, the diffusion model uses an L1 loss function for optimization during the training process, and the loss function compares the difference between the model-predicted noise and the actually added Gaussian noise, and is expressed as:

[0012]

[0013] , wherein is the input Gaussian noise, is the model-predicted noise, is the predefined signal preservation coefficient, is the cumulative product of the predetermined coefficient, and is expressed as , is the ground truth (GT) image, i.e., the image of the desired ideal enhancement effect, is the conditional variable, i.e., the input degraded underwater image, t is the time step, and the training method based on noise prediction makes the diffusion model learn the degradation distribution of the image, i.e., the diffusion model realizes image restoration when sampling;

[0014] Further, the diffusion model realizes image restoration when sampling by using a deterministic non-Markov sampling strategy to sample random noise from a standard Gaussian distribution First, according to the following formula, step sampling denoising is performed at (2000, 1500, 1000, 500) steps:

[0015]

[0016] where t is the number of time steps before step sampling, is the target number of steps of step sampling, and the formula predicts noise guides the denoising process at each jump time step to realize progressive recovery from noise to clear image, and for the jump of the last step (500, 0), it is not necessary to additionally increase the noise, and the formula of this step is expressed as:

[0017]

[0018] Step S03: Replace the large parameter self-attention model in the traditional diffusion model with a low-parameter channel attention mechanism with good color recovery effect, and construct a parallel double-branch structure in the AP-Trans module, which includes a time step encoding branch and a color channel processing branch. Wherein, the time step encoding branch adopts two GSC (GroupNorm-Swish-Conv) modules connected in series to process the time information, which is used to generate time step features ; the color channel processing branch calculates the channel weight through global average pooling and convolution, which is used to generate channel enhancement features .

[0019] Further, the specific structure of the AP-Trans module includes an input layer, parallel branches and a fusion layer. The input features are first pre-processed through convolution, and then divided into two independent branches of time step coding and channel enhancement. The time step coding branch adopts two GSC modules connected in series, each of which sequentially includes group normalization, a Swish activation function and a convolution layer, for extracting time step features. The channel enhancement branch first performs global average pooling on the input features, and then generates channel attention weights through convolution. The output features of the two branches are adaptively fused through a global color feature fusion module to effectively combine time step information and color information.

[0020] Step S04: fusion is performed using a global color feature fusion module. The module first extracts global features from the input features, and then generates fusion weights through two convolution and normalization operations, finally outputting fusion features. This design can adaptively adjust the weight of color information according to different time steps;

[0021] Further, the global color feature fusion module adopts a fusion strategy guided by global color features. First, the input time step features and channel enhancement features are globally averaged pooled,

[0022] to obtain global context information. This process can be represented by the formula:

[0023]

[0024] wherein represents the input of the module, represents the input after Conv3 convolution layer processing to obtain features, represents the channel attention feature of the Nth group, GAP represents global pooling, represents convolution with a kernel of n, represents a sigmoid activation function, represents a GSC module;

[0025] After two convolutions and layer normalization operations, fusion weights are generated through a sigmoid activation function to achieve adaptive weighted fusion of and . This process can be represented by the formula:

[0026]

[0027] wherein, denotes a global color feature extraction function, ReLU denotes a Relu activation function, LN denotes layer normalization, the design of the module allows the model to dynamically adjust the importance of color information according to different time steps and image contents, and then output fused features , the weight of the color information is adaptively adjusted according to different time steps;

[0028] Step S05: In order to further enhance the detail recovery ability of the model, the spatial attention mechanism is used in the diffusion model according to the application, and is input into the spatial attention module for detail enhancement. The spatial attention captures spatial information of different scales through parallel maximum pooling and average pooling operations, generates a detail attention map, and is used to enhance the details of the image blurred by the scattering effect. After the spatial information enhancement feature is obtained through the spatial attention mechanism , it is input into the multilayer vector machine for operation and information processing. The above steps constitute a complete attention-driven Trans encoding / decoding block;

[0029] Further, the spatial attention module uses a double-channel parallel pooling strategy to capture spatial features. The module simultaneously performs maximum pooling and average pooling operations. The maximum pooling helps to capture significant target features, and the average pooling helps to obtain global spatial information. After the results of the two kinds of pooling are spliced, the spatial feature pattern is extracted through 7x7 convolution, and finally the spatial attention map is generated through the sigmoid activation function. The attention map is used to enhance the key regions in the feature map, especially the detail regions affected by the scattering effect.

[0030] Step S06: The bidirectional interaction of the encoder and decoder features is realized through the global channel interaction module. The module sets a double global channel feature collection head at the jump connection of the U-shaped network, realizes the bidirectional selective transmission of the features, and finally generates a high-quality enhanced image;

[0031] Further, the global channel interaction module includes a double global channel feature collection head, which processes the encoder features and the decoder features respectively. Each feature collection head first performs a global average pooling operation to extract global statistical information at the channel level, then passes through two groups of processing units in turn, each group including a 1x1 convolution, a layer normalization, and a ReLU activation function, and finally generates a channel weight through another group of 1x1 convolution and layer normalization, using a sigmoid activation function. The process can be represented by the formula:

[0032]

[0033] wherein, denotes the encoder feature, The decoder features are represented, and the bidirectional selective transmission of features is realized through cross-feature weighting, and an enhanced image is generated.

[0034] Compared with the prior art, the present application has the beneficial effects that:

[0035] (1) The present application realizes the unique processing of time step coding and color information through the parallel structure design of the AP-Trans module, improves the modeling ability of the model to underwater image degradation;

[0036] (2) The introduction of the spatial attention mechanism significantly enhances the recovery ability of the model to the blurred details caused by scattering; and the designed global channel interaction module successfully solves the color fidelity problem caused by the introduction of spatial attention;

[0037] (3) By replacing the large parameter self-attention module in the traditional diffusion model with a lightweight channel attention mechanism, the model parameter quantity is significantly reduced and the inference speed is improved; at the same time, a dynamic skip sampling strategy is adopted, which reduces the 20-50 step sampling process of the traditional skip diffusion model to 5 steps, further improving the model inference efficiency;

[0038] (4) Experiments on public datasets show that the present application has achieved significant improvement compared with the prior art in reference indicators, especially in severely degraded underwater images, and the present application provides a stable and reliable real-time image enhancement solution for underwater robot vision systems. BRIEF DESCRIPTION OF DRAWINGS

[0039] The accompanying drawings are included to provide a further understanding of the present application, and constitute a part of the specification, which together with the embodiments of the present application, serve to explain the present application, and do not constitute a limitation on the present application. In the drawings:

[0040] Figure 1 is the model network structure diagram of the embodiment of the present application;

[0041] Figure 2 is the specific structure diagram of the global channel interconnection module in the embodiment of the present application;

[0042] Figure 3 is the single-step training process diagram in the embodiment of the present application;

[0043] Figure 4 is the skip inference sampling process in the embodiment of the present application;

[0044] Figure 5 is the comparison diagram of the experimental results of the present application and the results of the prior art. DETAILED DESCRIPTION

[0045] In order to make the objects, technical solutions and advantages of the present application clearer, the following will be combined with the drawings of the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. In the following description, the description of the known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0046] Please refer to Figures 1 to 4 , combined Figures 1 to 4 , the embodiments of the present application provide the following technical solutions: a lightweight underwater image enhancement method based on skip sampling diffusion model, the present application is characterized by effectively solving the interaction interference problem of time step coding and color information, and balancing the recovery of underwater image color and detail, the technical scheme mainly includes two processes of training and reasoning, the method specifically includes the following steps:

[0047] Step S01: set a fixed decreasing sequence from large to small as the signal preservation coefficient , the clear underwater image label is taken as the ideal target image , training based on a random process model;

[0048] In this embodiment, the training process is a Markov random process, that is, the result of the next step is only determined by the result of the current step and is irrelevant to the previous step. In order to ensure that the model is not sensitive to the fixed number of steps and increase the step number robustness of the model, a positive integer t is randomly extracted from a uniform distribution each time to learn the number of steps, according to the Markov chain, the label after adding noise to t steps is:

[0049]

[0050] , wherein is the cumulative product of the predetermined coefficient, , that is, the multiplication of all from step 0 to step t; is the input Gaussian noise, is the ideal target image;

[0051] Exemplarily, the single-step training process is shown in Figure 3 .

[0052] Step S02: input the degraded underwater image raw as a conditional variable and the random noise together into the diffusion model;

[0053] In the present embodiment, the diffusion model is optimized during training using an L1 loss function that compares the difference between the model-predicted noise and the actual added Gaussian noise, represented as:

[0054]

[0055] wherein, is the input Gaussian noise, is the model-predicted noise, is a predefined signal preservation coefficient, is the cumulative product of the predefined coefficients, represented as , is the ideal target image, the ground truth (GT) image, i.e., the image with the desired ideal enhancement effect, is the conditional variable, i.e., the input degraded underwater image, t is the time step, and the training method based on noise prediction enables the model to learn the degradation distribution of the image, thereby achieving high-quality image restoration during sampling;

[0056] Further, during the sampling process of the diffusion model, in order to improve the sampling efficiency, the present invention adopts a deterministic non-Markov sampling strategy as shown in Figure 4 , which uses a larger sampling step without affecting the generation quality to sample random noise from a standard Gaussian distribution

[0057]

[0058] wherein t is the number of time steps before jump sampling, is the target number of steps for jump sampling, and the formula predicts the noise guides the denoising process at each jump time step, achieving progressive recovery from noise to clear image. For the last step (500, 0) of jump sampling, there is no need to add extra noise, and the formula for this step is:

[0059]

[0060] Exemplary, the specific implementation method of the diffusion model during training is as follows:

[0061] 1) Sample noise from a standard Gaussian distribution;

[0062] 2) Calculate the cumulative coefficient according to the predefined variance ;

[0063] 3) Generate noisy image using reparameterization trick ;

[0064] 4) Input condition variable c (degraded underwater image) and time step t;

[0065] 5) Calculate L1 loss between model predicted noise and actual noise ;

[0066] 6) Optimize model parameters by backpropagation.

[0067] Exemplarily, the specific implementation of the diffusion model in the sampling process is as follows:

[0068] 1) Sample initial noise from standard Gaussian distribution ;

[0069] 2) Input noise , condition variable c and time step t into the model;

[0070] 3) Calculate the noisy image of the previous step according to the predicted noise ; ;

[0071] 4) Gradually reduce the noise level until the final enhanced image is obtained.

[0072] Exemplarily, the size of the input image in the method of the present application is not strictly limited. For large-size images exceeding the GPU memory limit, a sliding window strategy can be used for block processing. The recommended size of each image block is 256x256 pixels, and a certain overlap area (the recommended overlap rate is 0.1) is maintained between adjacent image blocks to ensure smooth transition at the splicing place. Finally, the processed image blocks are spliced into a complete enhanced image by weighted averaging. In order to improve the efficiency of processing large-size images;

[0073] Exemplarily, the sliding window strategy used in the present application is as follows:

[0074] 1) Divide the input image into multiple 256x256 image blocks;

[0075] 2) Maintain a 10% overlap area between adjacent image blocks;

[0076] 3) Process each image block independently;

[0077] 4) Splice the processed image blocks into a complete image by weighted averaging

[0078] Step S03: Build parallel time step encoding and channel enhancement branches in the AP-Trans module;

[0079] In the present embodiment Figure 2 , Figure 2 is a specific structure diagram of the global channel interconnection module in the embodiment of the present application, the specific structure of the AP-Trans module includes an input layer, parallel branches and a fusion layer, the input feature is first preprocessed by 3x3 convolution, and then is divided into two independent branches of time step coding and channel enhancement, the time step coding branch adopts two GSC modules connected in series, each GSC module sequentially includes group normalization, a Swish activation function and a 3x3 convolution layer, for extracting time step features, the channel enhancement branch first performs global average pooling on the input feature, and then generates channel attention weights through 1x1 convolution, the output features of the two branches are adaptively fused through a global color feature fusion module, to effectively combine the time step information and the color information;

[0080] For example, the detailed structure of the AP-Trans module includes:

[0081] 1) Input layer: 3x3 convolution preprocessing is performed on the input feature;

[0082] 2) Parallel branch: including a time step coding branch and a channel enhancement branch;

[0083] 3) Time step coding branch: composed of two GSC modules connected in series;

[0084] 4) Channel enhancement branch: global average pooling and 1x1 convolution are adopted;

[0085] 5) Global color feature fusion module: adaptive fusion of the features of the two branches is realized;

[0086] 6) Spatial attention module: the detail information in the feature map is enhanced.

[0087] In the present embodiment, in order to solve the real-time technical problem of the underwater image enhancement task, the large parameter self-attention model in the traditional diffusion model is replaced by a low parameter channel attention mechanism with good color restoration effect, and a parallel double-branch structure is constructed in the AP-Trans module, because the global pooling characteristic of the channel attention leads to a lack of fine-grained resolution ability for time step information, the double-branch structure includes a time step coding branch and a color channel processing branch, wherein the time step coding branch adopts two GSC (GroupNorm-Swish-Conv) modules connected in series to process the time information, for generating time step features ; the color channel processing branch calculates the channel weight through global average pooling and convolution, for generating channel enhancement features ;

[0088] Exemplarily, each of the two GSC modules in the time step encoding branch is composed of group normalization, a Swish activation function and a 3x3 convolution layer, and the channel enhancement branch adopts global average pooling and a 1x1 convolution to calculate channel weights; the outputs of the two branches are fused through a global color feature fusion module;

[0089] Exemplarily, the U-shaped network adopts a symmetrical encoder-decoder structure, contains four down-sampling and up-sampling stages, each encoding stage contains an AP-Trans module and a down-sampling layer with a step of 2, and the feature channel numbers are set to 32, 64, 128 and 256 in turn, correspondingly, each decoding stage contains an up-sampling layer and an AP-Trans module, and the feature channel numbers are 256, 128, 64 and 32 in turn; a global channel interaction module is arranged between the encoder and decoder features of the same scale to realize bidirectional selective transmission of features, and the conditional variable is used to guide the denoising process, ensure that the generated result is consistent with the content of the input image, and the time step t is used to control the denoising strength to realize progressive recovery from noise to clear image; this symmetrical design ensures gradual abstraction and fine reconstruction of features; the decoder adopts a convolutional neural network structure, and the last layer output is a 3xHxW tensor, where 3 represents the RGB three channels, H and W are the height and width of the input image respectively, the output tensor is processed through a tanh activation function to map the pixel value range to [-1, 1], and then adjusted to the [0, 1] range through linear transformation, representing the normalized RGB color value, this design ensures that the output image has a reasonable color distribution.

[0090] Step S04: the global color feature fusion module is adopted to fuse the time step features and the channel enhancement features ;

[0091] In this embodiment, the global color feature fusion module adopts a fusion strategy guided by global color features, specifically, first, the input time step features and the channel enhancement features are globally averaged pooled,

[0092] to obtain global context information, which can be expressed by the formula:

[0093]

[0094] wherein represents the input of the module, represents the input after Conv3 convolution layer processing to obtain the feature, represents the channel attention feature of the Nth group, and GAP represents global pooling, Convolution with the convolution kernel n, Sigmoid activation function, GSC module;

[0095] Further, through two convolution and layer normalization operations, and finally through the sigmoid activation function to generate fusion weights , realizing and adaptive weighted fusion, which can be expressed in the formula as:

[0096]

[0097] Where, global color feature extraction function, ReLU represents the Relu activation function, and LN represents the layer normalization. The design of this module allows the model to dynamically adjust the importance of color information according to different time steps and image content, and then output the fusion features This design can adaptively adjust the weight of color information according to different time steps;

[0098] For example, the specific processing process of the global color feature fusion module is as follows:

[0099] 1) Global average pooling is performed on the input features to obtain global statistical information in the channel dimension;

[0100] 2) Two groups of convolution and layer normalization operations are performed in turn;

[0101] 3) Fusion weights are generated through the sigmoid activation function;

[0102] 4) Weighted fusion of time step features and channel enhancement features is realized.

[0103] Step S05, the fusion features are sent to the spatial attention module; this module simultaneously performs maximum pooling and average pooling operations, and the pooling results are convolved and sigmoid activated to generate a spatial attention map, which is used to enhance the detail information in the features, and output the enhanced features ;

[0104] In this embodiment, to further enhance the detail recovery capability of the model, the present application innovatively adopts a spatial attention mechanism in the diffusion model, which The spatial attention module is fed to enhance details, and the spatial attention captures spatial information at different scales through parallel max-pooling and average-pooling operations to generate a detail attention map for enhancing image details blurred by the scattering effect; the spatial information enhanced features are obtained through the spatial attention mechanism After that, the multi-layer vector machine is fed to perform operations and information processing, and the above steps constitute a complete attention-driven Trans encoding / decoding block.

[0105] For example, the specific implementation process of the spatial attention module is as follows:

[0106] 1) Max-pooling and average-pooling operations are performed on the input features to obtain max-value features and average-value features with sizes of and

[0107] 2) The two pooling results are spliced in the channel dimension, and spatial feature patterns are extracted through convolution;

[0108] 3) A spatial attention map is generated through a sigmoid activation function;

[0109] 4) The attention map is multiplied by the input features to enhance important regions;

[0110] Specifically, max-pooling helps to capture significant target features, and average-pooling helps to obtain global spatial information. The spatial attention map generated by splicing the results of the two pooling operations is used to enhance key regions in the feature map, especially the detail regions affected by the scattering effect.

[0111] Step S06: Bidirectional interaction of encoder and decoder features is realized through a global channel interaction module;

[0112] In this embodiment, the global channel interaction module includes a double global channel feature collection head, which processes the encoder features and the decoder features respectively. Each feature collection head first performs a global average pooling operation to extract global statistical information at the channel level, then passes through two groups of processing units in turn, each group including a 1x1 convolution, a layer normalization, and a ReLU activation function, and finally generates a channel weight through another group of 1x1 convolution and layer normalization, using a sigmoid activation function. This process can be represented by the formula:

[0113]

[0114] wherein, represents the encoder features, ​The decoder features are represented, and the bidirectional selective transmission of features is realized through cross-feature weighting, which can effectively transmit detailed information while maintaining color fidelity, and finally generate a high-quality enhanced image.

[0115] Exemplarily, the global channel interaction module realizes feature interaction at the skip connection of the U-shaped network, and the specific processing process is as follows:

[0116] 1) The encoder features and the decoder features are respectively subjected to global average pooling;

[0117] 2) The pooled features are sequentially subjected to two groups of processing units, each group comprising a 1x1 convolution, a layer normalization and a ReLU activation function;

[0118] 3) After a group of 1x1 convolution and layer normalization, a sigmoid activation function is used to generate channel weights;

[0119] 4) Cross-feature weighting of and is realized to generate fused features.

[0120] In this embodiment, the experimental results of the present application and other methods are compared, and the following data are obtained ("up" and "down" respectively represent that the larger the value is, the better, and the smaller the value is, the better):

[0121]

[0122] It should be understood that the above specific embodiments of the present application are only used for illustrative or explanatory purposes of the principles of the present application, and do not constitute a limitation on the present application. Therefore, any modification, equivalent replacement, improvement, etc. made without departing from the spirit and scope of the present application shall be included in the protection scope of the present application. In addition, the appended claims of the present application are intended to cover all variations and modifications falling within the scope and boundary of the appended claims, or the equivalent forms of such scope and boundary.

[0123] It should be noted that in this document, relational terms such as first and second and the like can only be used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations exist in any such actual relationship or order. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus including a series of elements includes not only those elements, but also other elements not explicitly listed or inherent to such a process, method, article or apparatus.

[0124] Finally, it should be noted that the above only describes the preferred embodiments of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art will appreciate that the technical solutions described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalent ones. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A lightweight underwater image enhancement method based on a skip-sampling diffusion model, characterized by: The method comprises the following steps: Step S01: set a fixed descending sequence from large to small as the signal holding coefficient The clear underwater image label is taken as an ideal target image Training is performed based on a random process model; Step S02: obtaining the degraded underwater image as a condition variable , the diffusion model is input together with the time step t and its corresponding denoised image , the diffusion model adopts a spatial attention mechanism and is a U-shaped network structure Step S03: replacing the large-parameter self-attention model in the diffusion model with a low-parameter channel attention mechanism model to construct an attention-driven AP-Trans module, and constructing a parallel time step coding and channel enhancement branch in the AP-Trans module; The detailed structure of the AP-Trans module includes: Input layer: 3x3 convolution preprocessing of input features; Parallel branch: including a time step coding branch and a channel enhancement branch; Time step coding branch: composed of two GSC modules connected in series, and each GSC module is composed of group normalization, a Swish activation function and a 3x3 convolution layer; The time step encoding branch adopts two GSC modules in series to process time information, for generating time step features ; Channel enhancement branch: using global average pooling and 1x1 convolution; The channel enhancement branch calculates channel weights through global average pooling and convolution, for generating channel enhancement features ; Global color feature fusion module: realizing adaptive fusion of features of the two branches; The outputs of the time step coding branch and the channel enhancement branch are fused through the global color feature fusion module; Spatial attention module: enhancing the detail information in the feature map; Step S04: A global color feature fusion module is constructed to fuse the time step features and the channel enhanced features to obtain fused features ; Step S05, the fusion features are input into a spatial attention module adopting a spatial attention mechanism, maximum pooling and average pooling operations are performed, a spatial attention map is generated based on the pooling results, and enhanced features are output ; and ; and Step S06: finally realizing bidirectional interaction of the encoder and the decoder features through a global channel interaction module.

2. The light-weight underwater image enhancement method based on skip-sampling diffusion model according to claim 1, characterized in that: The training based on the random process model includes a training process and an inference process, the training process is a Markov random process with determined forward and reverse transition probability distributions, and the state transition at each step only depends on the current state.

3. The light-weight underwater image enhancement method based on skip-sampling diffusion model according to claim 1, characterized in that: The diffusion model uses an L1 loss function for optimization in the training process, and the loss function compares the difference between the predicted noise of the model and the actual added Gaussian noise, and is expressed as: ; wherein, is the input Gaussian noise, is the model predicted noise, is a predefined signal preserving coefficient, is the cumulative product of predefined coefficients, , is the ideal target image, ground truth image, i.e. the image for which the ideal enhancement effect is desired, is the conditioning variable, i.e. the input degraded underwater image, is the time step, the training regime based on noise prediction makes the diffusion model learn the degradation distribution of the image, i.e. the diffusion model implements image restoration when sampling.

4. The light-weight underwater image enhancement method based on skip-sampling diffusion model according to claim 3, characterized in that: The diffusion model realizes image restoration when sampling, which is realized by sampling random noise from a standard Gaussian distribution by using a deterministic non-Markov sampling strategy Initially, jump sampling denoising is performed at steps (2000, 1500, 1000, 500) according to the following formula: ; wherein, is the time step, is the target number of steps for the skip sampling, the formula is predicted by the U-shaped network guides the denoising process of each skip time step, realizes the progressive recovery from noise to clear image, and for the last step (500, 0) step of skip, without additional increase in noise, the formula of this step is represented as: ; Wherein, the specific implementation method of the diffusion model in the training process is as follows: 1) Sample noise from a standard Gaussian distribution ; 2) according to a predefined variance modulation calculating a cumulative coefficient ; 3) Generating noisy images using reparameterization trick ; 4) input condition variables and time step ; 5) L1 loss between model predicted noise and actual noise ​ 6) optimize the model parameters by back propagation; Wherein, the specific implementation of the diffusion model in the sampling process is as follows: 1) Sample initial noise from a standard Gaussian distribution ; 2) the noise , condition variables and time steps input model; 3) according to the predicted noise computing the previous step noisy image ; 4) gradually reduce the noise level until the final enhanced image is obtained.

5. The light-weight underwater image enhancement method based on skip-sampling diffusion model according to claim 4, characterized in that: The U-shaped network in the diffusion model adopts a symmetrical encoder-decoder structure, contains 4 down-sampling and up-sampling stages, each encoding stage contains an AP-Trans module and a down-sampling layer with a step of 2, and the feature channel numbers are set to 32, 64, 128 and 256 in turn, correspondingly, each decoding stage contains an up-sampling layer and an AP-Trans module, and the feature channel numbers are 256, 128, 64 and 32 in turn, a global channel interaction module is arranged between the encoder and decoder features of the same scale to perform bidirectional selective transmission of the features, and the conditional variable guides the denoising process, controls the denoising strength based on the time step t, the decoder adopts a convolutional neural network structure, the output of the last layer is a 3xHxW tensor, where 3 represents the RGB three channels, H and W are the height and width of the input image respectively, the output tensor is processed through a tanh activation function to map the pixel value range to [-1, 1], and finally adjusted to the [0, 1] range through a linear transformation, representing the normalized RGB color value, output image.

6. The light-weight underwater image enhancement method based on skip-sampling diffusion model according to claim 5, characterized in that: The global color feature fusion module adopts a fusion strategy guided by global color features, performs global average pooling on the input time step features and channel enhancement features ​ The process of obtaining global context information can be expressed as: ; wherein represents the input of the module, represents the input After processing by the Conv3 convolutional layer, the feature is obtained, represents the channel attention feature of the Nth group, and GAP represents global pooling, represents convolution with a convolution kernel k, represents a sigmoid activation function, represents a GSC module; After two convolution and layer normalization operations, the fusion weights are generated by a sigmoid activation function , which realizes and adaptive weighted fusion, and the process can be expressed by the formula: ; wherein, represents a global color feature extraction function, ReLU represents a Relu activation function, LN represents layer normalization, the design of the module allows the model to dynamically adjust the importance of color information according to different time steps and image content, and then output the fused features , and the weight of the color information is adaptively adjusted according to different time steps.

7. The light-weight underwater image enhancement method based on skip-sampling diffusion model according to claim 6, characterized in that: The diffusion model adopts a spatial attention mechanism, which is input into a spatial attention module for detail enhancement. The spatial attention module captures spatial information at different scales through parallel max-pooling and average-pooling operations, generates a detail attention map, and enhances image details blurred by the scattering effect. The spatial information enhanced features are obtained through the spatial attention mechanism After that, it is sent into a multi-layer vector machine for operation and information processing, forming a complete attention-driven Trans encoding / decoding block. The specific implementation method of the spatial attention module is as follows: 1) maximum pooling and average pooling operations are performed on the input features to obtain maximum value features and average value features with sizes of ​ 2) concatenating the two pooling results in the channel dimension, passing through convolution to extract spatial feature patterns; 3) generate a spatial attention map through a sigmoid activation function; 4) multiply the attention map with the input feature to enhance the important area.

8. The lightweight underwater image enhancement method based on skip-sampling diffusion model according to claim 7, characterized in that: The global channel interaction module includes double global channel feature collection heads, respectively processing encoder features and decoder features Each feature collection head first performs a global average pooling operation to extract global statistical information at the channel level, then sequentially passes through two sets of processing units, each set including a 1x1 convolution, layer normalization, and a ReLU activation function, and finally generates channel weights using a sigmoid activation function after another set of 1x1 convolution and layer normalization. This process can be represented by the formula: ; wherein, represents an encoder feature, represents a decoder feature, and the bidirectional selective transmission of the features is realized by cross-feature weighting to generate an enhanced image.

9. The lightweight underwater image enhancement method based on skip-sampling diffusion model according to claim 8, characterized in that: The global channel interaction module realizes feature interaction at the skip connection in the U-shaped network structure, and the specific processing process is as follows: 1) Global average pooling is applied to the encoder features and decoder features respectively; 2) the pooled features pass through two groups of processing units in turn, each group containing a 1x1 convolution, a layer normalization and a ReLU activation function; 3) after passing through a group of 1x1 convolution and layer normalization, a channel weight is generated by using a sigmoid activation function; 4) Implementations and cross feature weighting of the cross features to generate fused features.

Citation Information

Cited By

  • Underwater degraded image restoration method based on consistency model and related device

    CN122048731A