Underwater image enhancement method and system based on perception guidance mechanism
By employing a multi-branch architecture design based on a perception-guided mechanism, the problems of color distortion and low contrast in underwater images are solved, achieving high-quality image enhancement and precise enhancement of target areas, thereby improving the application efficiency of underwater images in complex environments.
Patent Information
- Application Number
- CN202511642650.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-11-11
AI Technical Summary
Underwater images suffer from color distortion, reduced contrast, and blurred details due to wavelength-dependent absorption and scattering effects, making it difficult for existing technologies to be effectively applied in high-level vision tasks such as target detection and scene recognition.
A multi-branch architecture based on a perception-guided mechanism is adopted, which combines texture enhancement and color correction branches. Feature fusion is performed through a perception-guided attention module and gradient field distribution differences to generate high-quality enhanced images.
It significantly improves the visual quality and robustness of underwater images, enhances the performance of target detection and scene recognition, and adapts to different underwater environments.
Smart Images

Figure CN121095093B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to an underwater image enhancement method and system based on a perception-guided mechanism. Background Technology
[0002] Underwater engineering is an important research direction in the field of remote sensing, encompassing applications such as seabed engineering monitoring and marine system detection. In this research, underwater optical images are widely used due to their high resolution and rich color information. However, wavelength-related absorption and scattering effects in water pose significant challenges to underwater optical imaging. These physical factors lead to various degradation phenomena in underwater images, such as color distortion, decreased contrast, and blurred details, severely limiting their practical application value. Even with high-quality image acquisition equipment, the inherent degradation characteristics of water can still cause a significant decrease in underwater image quality. Therefore, improving the clarity of underwater images and correcting their color distortion are urgent technical problems to be solved in underwater optical detection and applications. Summary of the Invention
[0003] To address the aforementioned problems, this invention provides an underwater image enhancement method and system based on a perception-guided mechanism, aiming to improve the visual quality of underwater images.
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] On one hand, embodiments of the present invention provide an underwater image enhancement method based on a perception-guided mechanism, the method comprising the following steps:
[0006] S100: Acquire underwater images as training samples and input them into a multi-branch architecture perception-driven underwater image enhancement network, which includes a texture enhancement branch and an adaptive color correction branch.
[0007] S200, in the adaptive color correction branch, performs color correction processing on underwater images to generate color correction feature maps;
[0008] In the texture enhancement branch, the S300 performs feature extraction and mapping enhancement processing on underwater images to generate accurate perception enhancement features. The accurate perception enhancement features are then input into the feature reconstruction module, which generates texture enhancement feature maps through a progressive channel compression structure and a residual network.
[0009] S400 determines the gradient magnitude weight based on the difference in gradient field distribution between the texture enhancement feature map and the color correction feature map, and uses the gradient magnitude weight to perform weighted fusion of the texture enhancement feature map and the color correction feature map to generate an enhanced image;
[0010] S500: The perception-driven underwater image enhancement network is trained and optimized by the loss function value between the enhanced image and the corresponding reference ground image to obtain the underwater image enhancement model; the underwater image to be enhanced is enhanced by the underwater image enhancement model, and the corresponding enhanced image is output.
[0011] Optionally, in S200, the step of performing color correction processing on the underwater image to generate a color correction feature map includes:
[0012] S210, determine the cumulative histogram of the underwater image, and determine the dark threshold and bright threshold through preset truncation parameters;
[0013] S220, the pixel values of each channel are truncated based on the dark threshold and the bright threshold, and the truncated pixel values are linearly expanded to a preset range through a mapping formula to generate corrected single-channel image data; the mapping formula is a piecewise linear function, which is used to perform different linear mapping processes on pixel values below the dark threshold, above the bright threshold, and in between, to map the pixel values from the original range to the target range.
[0014] S230 merges the corrected single-channel image data into a multi-channel image and inputs it into the generative adversarial network to generate the corresponding color correction feature map.
[0015] Optionally, in S300, the step of performing feature extraction and mapping enhancement processing on the underwater image in the texture enhancement branch to generate accurate perception enhancement features includes:
[0016] S310, globally enhance the input underwater image to obtain a globally enhanced image;
[0017] S320, The global enhanced image is simultaneously input to the parallel feature extraction module and semantic segmentation module to extract basic visual semantic features and generate a semantic segmentation mask, respectively;
[0018] S330, The basic visual semantic features are input into the spatial-channel collaborative attention module, and spatial-channel collaborative enhanced features are generated through the collaborative optimization of spatial attention and channel attention;
[0019] S340, the semantic segmentation mask and the spatial-channel collaborative enhancement feature are fused pixel by pixel, and the influence of the mask is adjusted by an adjustable weight coefficient to generate perceptual enhancement features;
[0020] S350, the perception mapping module is used to perform dynamic range remapping and outlier filtering on the perception enhancement features to generate accurate perception enhancement features.
[0021] Optionally, in S320, the step of simultaneously inputting the global enhanced image into the parallel feature extraction module and semantic segmentation module to extract basic visual semantic features and generate a semantic segmentation mask, respectively, includes:
[0022] In the feature extraction module, the basic visual semantic features of the global enhanced image are gradually extracted through two consecutive 3×3 convolution operations and the ReLU activation function.
[0023] In the semantic segmentation module, a encoder-decoder structure is used to perform pixel-level classification of the globally enhanced image, generating a semantic segmentation mask with the same resolution as the underwater image.
[0024] Optionally, in S330, the step of inputting the basic visual semantic features into the spatial-channel collaborative attention module, and generating spatial-channel collaborative enhanced features through the collaborative optimization of spatial attention and channel attention, includes:
[0025] S331, In the spatial attention stage, attention weights in the horizontal and vertical directions are calculated by depthwise separable convolution and group normalization, respectively.
[0026] S332, Based on the attention weights in the horizontal and vertical directions, the basic visual semantic features are subjected to bidirectional spatial attention weighting to generate spatially enhanced features;
[0027] S333, in the channel attention stage, channel attention weights are generated by performing average pooling and multi-head self-attention calculation on spatial enhancement features;
[0028] S334, apply the channel attention weights to the spatial enhancement features after average pooling to generate spatial-channel co-enhanced features.
[0029] Optionally, in S300, the step of inputting the precise perception enhancement features into the feature reconstruction module and generating a texture enhancement feature map through a progressive channel compression structure and a residual network includes:
[0030] S301, the precise perception enhancement features are processed through a progressive channel compression structure to obtain preliminary reconstructed features; the progressive channel compression structure includes four convolutional modules connected in sequence, wherein the first three convolutional modules are each composed of a 3×3 convolutional kernel and a ReLU activation function, and the fourth convolutional module is composed of a 3×3 convolutional kernel and a Sigmoid activation function;
[0031] S302, the precise perception enhancement features are input into the residual network, the precise perception enhancement features are convolved using 1×1 convolution, and nonlinear mapping is performed through the Sigmoid activation function to generate residual compensation features whose numerical range is consistent with the initial reconstructed features.
[0032] S303, the preliminary reconstructed features and the residual compensation features are added pixel by pixel to obtain a texture enhancement feature map.
[0033] Optionally, in S400, determining the gradient magnitude weight based on the difference in gradient field distribution between the texture enhancement feature map and the color correction feature map, and then using the gradient magnitude weight to perform weighted fusion of the texture enhancement feature map and the color correction feature map to generate an enhanced image, includes:
[0034] S410 uses the Scharr operator to calculate the gradient field distribution of the texture enhancement feature map and the color correction feature map respectively, and obtains the gradient magnitude feature map through square root operation.
[0035] S420, Gaussian smoothing is performed on the gradient magnitude feature map to suppress noise and preserve edge structure, resulting in a smoothed gradient magnitude map.
[0036] S430 normalizes the smoothed gradient magnitude map and amplifies the gradient differences between regions by exponential amplification to generate gradient magnitude weights.
[0037] S440, a balance factor is introduced to interpolate and fuse the gradient magnitude weights to obtain the fusion weights of the texture enhancement branch and the color correction branch;
[0038] S450, the texture enhancement feature map and color correction feature map are weighted and fused pixel by pixel using the fusion weight, and the fusion result is limited to a preset range by the pixel value truncation function to generate an enhanced image.
[0039] Optionally, in S500, the step of training and optimizing the perception-driven underwater image enhancement network using the loss function value between the enhanced image and the corresponding reference ground image to obtain the underwater image enhancement model includes:
[0040] S510, calculates the absolute error between the enhanced image and the reference ground image at each pixel and each channel;
[0041] S520: The absolute error values of all pixels are averaged based on the height, width and number of channels of the image to obtain the L1 norm loss function value.
[0042] S530 uses the backpropagation algorithm to update the model parameters of the perception-driven underwater image enhancement network based on the L1 norm loss function value until the preset convergence condition is met or the maximum number of iterations is reached, thus obtaining the underwater image enhancement model.
[0043] On the other hand, embodiments of the present invention provide an underwater image enhancement system based on a perception-guided mechanism, comprising:
[0044] At least one processor;
[0045] At least one memory for storing at least one program;
[0046] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.
[0047] On the other hand, embodiments of the present invention provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the above-described method.
[0048] The beneficial effects of this invention are as follows: This invention discloses an underwater image enhancement method and system based on a perception-guided mechanism. By introducing a perception-guided mechanism and combining a multi-branch architecture design for texture enhancement and color correction, this invention can effectively address problems such as color distortion, decreased contrast, and blurred details in underwater images. Through progressive feature extraction and dynamic mapping enhancement processing, this invention achieves accurate modeling of the degradation characteristics of underwater images and optimizes the feature fusion process using gradient field distribution differences, thereby generating high-quality enhanced images. Furthermore, the training optimization strategy based on the loss function ensures the robustness and generalization ability of the model in different scenarios. In summary, this invention significantly improves the visual quality of underwater images. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 This is a schematic flowchart of an underwater image enhancement method based on a perception-guided mechanism according to an embodiment of the present invention;
[0051] Figure 2 This is the overall architecture diagram of the perceptual enhancement-based multi-branch generative adversarial network framework in this embodiment of the invention;
[0052] Figure 3 yes Figure 2 An example diagram of the architecture of the perception-guided attention module;
[0053] Figure 4 yes Figure 2 An example diagram of the architecture of the mid-space channel collaborative attention module;
[0054] Figure 5 yes Figure 2 An example architecture diagram of the semantic segmentation module;
[0055] Figure 6 yes Figure 2 An example architecture diagram of the perceptual mapping module;
[0056] Figure 7 These are example images of the original underwater image, reference image, and enhanced image in embodiments of the present invention. Detailed Implementation
[0057] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0058] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of this invention; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this invention as detailed in the appended claims.
[0059] It is understood that the terms “first,” “second,” etc., used in this invention may be used herein to describe various concepts, but unless specifically stated otherwise, these concepts are not limited by these terms. These terms are used only to distinguish one concept from another. For example, first information may also be referred to as second information without departing from the scope of embodiments of the invention, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to determination” as used herein may be interpreted as “when…” or “when…” or “in response to determination.”
[0060] The terms “at least one,” “multiple,” “each,” “any,” etc., used in this invention, “at least one” includes one, two, or more than two; “multiple” includes two or more than two; “each” refers to each of the corresponding multiple; and “any” refers to any one of the multiple.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.
[0062] Early research on underwater image enhancement primarily focused on constructing physical models that conformed to underwater optical degradation mechanisms, using mathematical modeling to invert the degradation process and achieve image restoration. However, such methods have significant limitations. First, the statistical priors they rely on are prone to failure in complex aquatic environments, often leading to overcorrection of colors or loss of detail. Furthermore, model parameters need to be manually adjusted for different water quality conditions, such as turbidity and plankton concentration, limiting their generalization ability. These issues often restrict the effectiveness of underwater vision applications, including target detection and scene recognition.
[0063] To overcome these bottlenecks, related research proposes integrating physical models with data-driven methods, aiming to synergistically leverage the interpretability of mathematical modeling and the representational learning capabilities of neural networks. However, during the integration process, the simplifying assumptions of the physical model may neglect forward scattering or non-uniform illumination, often leading to mismatch issues with real-world scenes. Another type of research uses multi-camera array systems to compensate for the feature defects of a single camera. While this can effectively improve image quality, its high hardware coordination costs and calibration complexity hinder large-scale engineering deployment.
[0064] Meanwhile, underwater images often contain multiple degradation factors simultaneously. To address this, related research employs a multi-branch architecture to specifically model and optimize different degradation features such as color and texture. These methods achieve a synergistic improvement in overall enhancement by clearly distinguishing degradation types and assigning dedicated processing branches.
[0065] Currently, underwater image enhancement methods have made significant progress in improving the overall visual quality of images. However, in applications such as target detection and tracking, where high regional accuracy is required, relying solely on global optimization strategies is often insufficient. These tasks typically require precise enhancement of specific target regions within the image to improve detection robustness and localization accuracy. Existing methods often apply uniform color correction or enhancement methods indiscriminately to the entire image, ignoring the content differences between different regions. This can easily lead to problems such as color oversaturation and edge artifacts in some areas, severely impacting the performance of subsequent advanced vision tasks.
[0066] Attention mechanisms, by mimicking the selective focusing characteristics of human vision, offer an effective technical approach to this problem. Researchers have used attention mechanisms to differentially enhance key regions, highlighting target features while suppressing background noise, significantly improving the usability of underwater images in detection and tracking tasks. However, network attention differs fundamentally from human cognition, often focusing away from semantically critical regions. In weakly supervised localization tasks, standard attention is easily affected by background interference, leading to unnecessary high responses in target boundary regions and feature misalignment. This bias is particularly pronounced in complex underwater scenes, where turbulent disturbances or biofluorescence effects may mislead the attention module into over-focusing on highlighted areas, resulting in target loss.
[0067] In summary, underwater images are affected by wavelength-related absorption and scattering effects, resulting in degradation phenomena such as color distortion, low contrast, and blurred details, which severely restricts their application performance in high-level vision tasks such as target detection and scene recognition.
[0068] This invention addresses technical problems in related technologies by proposing an underwater image enhancement method and system based on a perception-guided mechanism. By combining a perception-guided mechanism with a multi-branch architecture design, this invention successfully solves several key problems in the field of underwater image enhancement. First, in the collaborative processing of texture restoration and color correction, a dual-branch structure design achieves accurate modeling of detail information and color distortion. Second, the introduction of a semantically guided attention mechanism enables visual enhancement guidance for key target regions, further improving the enhancement effect on target regions while suppressing background noise interference. Furthermore, the combination of progressive feature extraction and dynamic mapping enhancement not only improves the computational efficiency of the perception-driven underwater image enhancement network but also significantly enhances feature representation capabilities, resulting in enhanced images with high levels of visual quality and structural integrity.
[0069] refer to Figure 1 ,like Figure 1 The image shown is an underwater image enhancement method based on a perception-guided mechanism provided by an embodiment of the present invention. The method includes the following steps:
[0070] S100: Acquire underwater images as training samples and input them into a multi-branch architecture perception-driven underwater image enhancement network, which includes a texture enhancement branch and an adaptive color correction branch.
[0071] S200, in the adaptive color correction branch, performs color correction processing on underwater images to generate color correction feature maps;
[0072] In the texture enhancement branch, the S300 performs feature extraction and mapping enhancement processing on underwater images to generate accurate perception enhancement features. The accurate perception enhancement features are then input into the feature reconstruction module, which generates texture enhancement feature maps through a progressive channel compression structure and a residual network.
[0073] S400 determines the gradient magnitude weight based on the difference in gradient field distribution between the texture enhancement feature map and the color correction feature map, and uses the gradient magnitude weight to perform weighted fusion of the texture enhancement feature map and the color correction feature map to generate an enhanced image;
[0074] S500: The perception-driven underwater image enhancement network is trained and optimized by the loss function value between the enhanced image and the corresponding reference ground image to obtain the underwater image enhancement model; the underwater image to be enhanced is enhanced by the underwater image enhancement model, and the corresponding enhanced image is output.
[0075] refer to Figure 2 This invention proposes a perceptual enhancement-based multi-branch generative adversarial network framework (PFHE-GAN), which includes a texture enhancement branch and a color correction branch.
[0076] The texture enhancement branch preprocesses images using generative adversarial networks (GANs) and introduces a perception-guided attention module. By fusing high-level semantic information, it guides human visual perception of the attention area, thereby accurately focusing on key targets and restoring detailed information.
[0077] The color correction branch uses the Histogram Color Correction Module (HCCM) to process underwater images and then inputs them into the baseline generative adversarial network (GAN) for supplementary enhancement. Relying on the adaptive mapping and truncation mechanism of the cumulative histogram, it effectively restores the natural color performance.
[0078] The outputs of the two branches are integrated by the Gradient Attention Fusion (GAM) module to collaboratively optimize texture details and color topology.
[0079] Furthermore, this framework exhibits excellent scalability and compatibility, allowing for further optimization of existing model performance and visual perception quality by replacing different baseline augmentation networks. Experimental results on multiple benchmark datasets demonstrate that PFHE-GAN outperforms current mainstream methods in several metrics, including PSNR, SSIM, UIQM, and UCIQE. Simultaneously, in real-world underwater tasks such as object detection and semantic segmentation, PFHE-GAN significantly improves downstream task performance, fully validating its robustness and practical value in complex underwater environments. The framework consistently delivers performance improvements across different baseline networks, further proving its excellent plug-and-play characteristics.
[0080] Extensive experimental results demonstrate that the perceptual enhancement-based multi-branch generative adversarial network framework PFHE-GAN provided in this invention achieves state-of-the-art performance on multiple standard datasets and in real-world application scenarios, exhibiting excellent robustness and practical value in complex underwater environments. Furthermore, the framework employs a modular design, allowing for seamless integration into existing enhancement networks to further optimize performance and improve visual attention. This invention bridges the gap between low-level image enhancement and high-level vision tasks, providing a flexible and efficient solution that significantly promotes the development of marine exploration and autonomous underwater systems.
[0081] The following is a specific embodiment provided by the present invention:
[0082] This invention provides a perceptual enhancement-based multi-branch underwater image enhancement network (PFHE-GAN), such as... Figure 2 As shown, the core idea is to introduce a separable, plug-and-play Perceptual Guided Attention Module (PGAM) on top of the global enhancement network to achieve targeted enhancement of key target regions. The PGAM has broad architectural compatibility, accepting the output of any underwater image enhancement baseline network and can be integrated without structural modifications. Its core design involves coupling the Segment Anything Model (SAM) and the Spatial and Channel Synergistic Attention (SCSA) module, combined with a specially designed Perceptual Mapping Module (PMM), to dynamically embed human visual perception into the feature optimization process. This significantly enhances the model's ability to focus on key underwater target regions, achieving secondary enhancement of the subject information in the baseline network output.
[0083] The PFHE-GAN network adopts a dual-branch collaborative architecture, which includes a texture enhancement branch and a color correction branch.
[0084] The texture enhancement branch, guided by the perception-guided attention module, enhances the main image information a second time, building upon the overall enhancement provided by the underwater image enhancement baseline network. The color correction branch, centered on the histogram color correction module (HCCM) designed in this invention, inputs the degraded underwater image X into the histogram color correction module to obtain a color-corrected image. Through the collaboration of the histogram color correction module and the baseline enhancement network, the physical restoration of color distortion in the underwater image is achieved. Finally, a proposed gradient attention module (GAM) integrates the features of both branches, outputting an enhanced image that combines human visual perception characteristics with strong task adaptability.
[0085] In some embodiments, in S200, the step of performing color correction processing on the underwater image to generate a color correction feature map includes:
[0086] S210, determine the cumulative histogram of the underwater image, and determine the dark threshold and bright threshold through preset truncation parameters;
[0087] S220, the pixel values of each channel are truncated based on the dark threshold and the bright threshold, and the truncated pixel values are linearly expanded to a preset range through a mapping formula to generate corrected single-channel image data; the mapping formula is a piecewise linear function, which is used to perform different linear mapping processes on pixel values below the dark threshold, above the bright threshold, and in between, to map the pixel values from the original range to the target range.
[0088] S230 merges the corrected single-channel image data into a multi-channel image and inputs it into the generative adversarial network to generate the corresponding color correction feature map.
[0089] It should be noted that due to differences in underwater channel attenuation and light scattering effects, underwater images often exhibit problems such as color distortion and limited pixel dynamic range. To address this, this invention designs a Histogram Color Correction Module (HCCM), which utilizes the global perception of pixel distribution through histograms and the linear mapping of different pixel intervals to achieve color restoration and adaptive adjustment of pixel dynamic range in underwater images.
[0090] The cumulative histogram reflects the pixel distribution range of an image. By performing dynamic range correction on each color channel of the image, the problems of color distortion and insufficient dynamic range of pixel distribution in underwater images can be effectively alleviated. This invention first decomposes the underwater image X into three channels: R / G / B. The set of pixels for each channel is as follows:
[0091] ;
[0092] Where H and W represent the height and width of the image, respectively. This represents the pixel value at position (i,j) in the image. Then, a single-channel histogram is calculated:
[0093] ;
[0094] Where k is the grayscale value of the pixel. This is an indicator function that takes the value 1 when the condition is met, and 0 otherwise; Let k be the number of pixels in the image with a gray value equal to k, thus obtaining the corresponding histogram distribution. By summing the histograms, we can obtain the cumulative histogram:
[0095] ;
[0096] in, This represents the cumulative number of pixels with a grayscale value not exceeding k, where N is the total number of pixels in the image, N = H × W. To avoid the influence of extreme pixel values (such as pure black or pure white dots) and to make fuller use of effective pixel values, this invention uses two truncation parameters. and And based on experience, :
[0097] ;
[0098] ;
[0099] Where b and t represent the dark / bright thresholds of the histogram, respectively. Clearly, simply truncating extreme values cannot effectively solve the problems of color distortion and insufficient dynamic range of pixel distribution. Selective absorption by water causes most pixels to concentrate in low-brightness areas, resulting in an overall greenish or bluish tint. Therefore, this invention uses the mapping formula f(x) to truncate extreme values and then performs mapping enhancement on the truncated image pixel values, linearly expanding the pixel values originally compressed into a small range to the entire [0, 255] range:
[0100] ;
[0101] By processing the pixel values of the three channels using the mapping formula f(x), the mapped R / G / B channels can be obtained. The three channels are then merged to obtain the final color-corrected image. :
[0102] ;
[0103] Color-corrected images The input is fed into the underwater image enhancement baseline generative adversarial network (GAN). By leveraging the synergistic effect of the histogram color correction module and the underwater image enhancement baseline GAN, a color correction feature map with more natural color restoration is obtained. ; .
[0104] The histogram color correction module, as a non-learning preprocessing module, does not participate in network training. While preserving the original color topology, it enhances the global contrast and color diversity of the input image, helping the subsequent network to better learn the underwater image degradation-sharpening mapping relationship. Furthermore, this design aligns with the separable architecture of PFHE-GAN, achieving broad compatibility with existing underwater image enhancement baseline networks.
[0105] refer to Figure 3In some embodiments, in S300, the step of performing feature extraction and mapping enhancement processing on the underwater image in the texture enhancement branch to generate accurate perception enhancement features includes:
[0106] S310, globally enhance the input underwater image to obtain a globally enhanced image;
[0107] S320, The global enhanced image is simultaneously input to the parallel feature extraction module and semantic segmentation module to extract basic visual semantic features and generate a semantic segmentation mask, respectively;
[0108] Specifically, in the feature extraction module, the basic visual semantic features of the global augmented image are gradually extracted through two consecutive 3×3 convolution operations and the ReLU activation function; in the semantic segmentation module, the global augmented image is classified at the pixel level through an encoder-decoder structure to generate a semantic segmentation mask with the same resolution as the underwater image.
[0109] S330, The basic visual semantic features are input into the spatial-channel collaborative attention module, and spatial-channel collaborative enhanced features are generated through the collaborative optimization of spatial attention and channel attention;
[0110] S340, the semantic segmentation mask and the spatial-channel collaborative enhancement feature are fused pixel by pixel, and the influence of the mask is adjusted by an adjustable weight coefficient to generate perceptual enhancement features;
[0111] S350, the perception mapping module is used to perform dynamic range remapping and outlier filtering on the perception enhancement features to generate accurate perception enhancement features.
[0112] Specifically, the perceptual enhancement features are remapped to the dynamic range of the original spatial-channel co-enhanced features to generate mapped enhancement features; the mean and standard deviation of the mapped enhancement features are calculated through statistical constraints, and outlier filtering is performed using three times the standard deviation as a reasonable value range to generate accurate perceptual enhancement features.
[0113] It should be noted that, to address the problem of insufficient focus on key target regions in the global optimization of existing underwater image enhancement methods, this invention proposes a perception-guided attention module that is widely compatible with existing underwater image enhancement baseline networks, the structure of which is as follows: Figure 3As shown, the perception-guided attention module is the core innovation of this invention. It aims to perform semantically perception-driven secondary enhancement on the output of the baseline network to address the problem of insufficient subject prominence caused by global enhancement. As an independent post-processing module, the perception-guided attention module does not rely on a specific baseline network structure. It receives three-channel RGB images as input and outputs three-channel RGB images, allowing seamless integration into the output of any underwater image enhancement model without modifying the original network architecture or retraining. Its core idea is to introduce segmentation priors from human visual perception. By using a semantic segmentation mask as high-level semantic information, it effectively regulates the distribution of spatial-channel collaborative attention, thereby achieving precise focusing on key target regions.
[0114] refer to Figure 4 In some embodiments, in S330, the input of the basic visual semantic features to the spatial-channel collaborative attention module, and the generation of spatial-channel collaborative enhanced features through the collaborative optimization of spatial attention and channel attention, includes:
[0115] S331, In the spatial attention stage, attention weights in the horizontal and vertical directions are calculated by depthwise separable convolution and group normalization, respectively.
[0116] S332, Based on the attention weights in the horizontal and vertical directions, the basic visual semantic features are subjected to bidirectional spatial attention weighting to generate spatially enhanced features;
[0117] S333, in the channel attention stage, channel attention weights are generated by performing average pooling and multi-head self-attention calculation on spatial enhancement features;
[0118] S334, apply the channel attention weights to the spatial enhancement features after average pooling to generate spatial-channel co-enhanced features.
[0119] Specifically, using an underwater image enhancement baseline network, the input underwater image X is first globally enhanced to obtain a globally enhanced image. : Globally enhance the image. Simultaneously, the input is fed into the parallel Feature Extraction Module (FEM) and semantic segmentation module to further achieve precise focusing on key target regions. The core idea of the feature extraction module is to progressively refine the globally enhanced image through two consecutive 3×3 convolutional operations and the ReLU activation function. Basic visual semantic features F:
[0120] ;
[0121] in, and They represent two respectively Convolution operation, This represents the ReLU activation function.
[0122] Underwater images are often affected by multiple degradation factors such as light attenuation, color shift, and suspended particles, resulting in a highly uneven distribution of effective information across both spatial and channel dimensions. Traditional attention mechanisms often focus only on single-dimensional features, making it difficult to simultaneously capture spatial saliency and channel dependence, thus limiting the comprehensiveness and accuracy of the enhancement effect. This paper addresses this issue by using a spatial-channel collaborative attention module to deeply coordinate spatial and channel attention. On the one hand, spatial attention highlights locally salient regions and suppresses invalid background interference; on the other hand, channel attention adaptively adjusts the weights of different spectral band features to compensate for the lack of color and spectral information in underwater images. This significantly improves the model's ability to effectively extract structural and semantic information from images in complex underwater environments.
[0123] To address this, the present invention introduces a spatial channel collaborative attention module, which inputs the basic visual semantic features F extracted by the feature extraction module into the spatial channel collaborative attention module to achieve spatial-channel collaborative enhancement of the features. Specifically, in the spatial attention stage, the model calculates attention weights from both the horizontal and vertical directions:
[0124] ;
[0125] ;
[0126] in, This represents a depthwise separable convolution with a kernel size of k, and GN represents grouped normalization. Use the Sigmoid activation function; , These are the spatial attention weights in the horizontal and vertical directions, respectively. and (i=1,2,3,4) represent the feature map branches in the horizontal and vertical directions, respectively. Spatial augmentation features are obtained through bidirectional spatial attention weighting. :
[0127] , ;
[0128] Where B, C, H, and W represent the batch size, number of channels, height, and width, respectively. This represents element-wise multiplication. During the channel attention phase, the spatial channel collaborative attention module is based on spatial enhancement features. Average pooling is used to adaptively model channel importance while compressing spatial dimensions:
[0129] , ;
[0130] in, and These are the spatial augmentation features after average pooling. The height and width are defined by AvgP (Average Pooling) and GN (Group Normalization). The spatial augmentation features are then derived from the average pooling operation. Spatial channel collaborative attention module with the help of Depthwise separable convolution Implementing multi-head self-attention parallel computation:
[0131] ;
[0132] ;
[0133] ;
[0134] Where Q, K, and V represent the query, key, and value, respectively. Finally, the channel attention weights are obtained through Softmax gating:
[0135] ;
[0136] in, , All are scaling factors. This is achieved by adjusting the channel attention weights. Spatial augmentation features applied to average pooling To achieve collaborative optimization of spatial-channel attention:
[0137] ;
[0138] in, This is a feature that enhances spatial-channel synergy.
[0139] While the spatial-channel collaborative attention module can achieve collaborative modeling at both the spatial and channel levels, its attention distribution is prone to randomness in the absence of semantic constraints, leading to a shift in focus towards key target regions. Although this approach achieves significant improvements in metrics, it is difficult to adapt to real-world application scenarios.
[0140] refer to Figure 5To address this, this invention introduces a semantic segmentation module. The semantic segmentation mask generated by this module serves as a priori for advanced human visual perception, effectively regulating the model's focus on key target regions. However, it's worth noting that in complex underwater scenes, the semantic segmentation module may missegment due to uneven lighting or high-brightness noise, such as misidentifying scattered light spots as target objects, thus causing the attention mechanism to deviate from the true semantic subject. Therefore, this invention chooses to globally enhance the image... Semantic segmentation is performed on the underwater image X, rather than directly on the underwater image X. Because an underwater image enhancement baseline network is introduced as a preprocessing step, the image is globally enhanced. The visual quality has been initially improved, with color distortion and detail clarity being initially reduced, thereby significantly improving the reliability of the segmentation results of the semantic segmentation module and providing high-quality semantic guidance priors for the standardization of spatial-channel collaborative attention.
[0141] In the semantic segmentation module, to ensure the versatility and plug-and-play nature of the perception-guided attention module, this invention employs the Automatic Mask Generation (AMG) mode of the semantic segmentation module to globally enhance the image. Semantic segmentation is performed to obtain multi-scale target masks in a non-cue manner, and mask filtering is performed using an IoU threshold. Although AMG incurs additional computational overhead, its ability to operate without human intervention ensures seamless integration of the module in any input scenario.
[0142] To further achieve precise enhancement of key regions, this invention combines semantic segmentation masks with spatial-channel co-enhancement features. Pixel-by-pixel multiplication accurately amplifies the response of the target region while suppressing non-target regions. To avoid excessive perturbation of the overall feature distribution by segmentation priors based on human visual perception, this invention introduces adjustable weight coefficients. The degree of influence of the mask was adjusted. This was verified through ablation experiments. The model achieves the best balance across all metrics, and the experimental results are shown in Table 1 below. Therefore, it is considered the optimal parameter setting for the perception-guided attention module.
[0143] Table 1: The impact of different adjustable weight coefficients on model performance;
[0144]
[0145] Finally, combine it with By combining these elements, semantic constraints and underlying enhanced features complement each other, maintaining the integrity of the overall feature distribution while significantly highlighting the representational power of key regions.
[0146] ;
[0147] in, Representing perceptual enhancement features, Masks are binary semantic segmentation masks generated by the semantic segmentation module. Used to control the modulation intensity of attention weights by the semantic segmentation mask. This indicates unobtrusive guidance. Then it is entirely dominated by the mask.
[0148] refer to Figure 6 To prevent problems such as dynamic range distortion, excessive noise amplification, or abnormal foreground / background contrast during the enhancement process, this invention designs a perceptual mapping module to stabilize feature distribution and improve reconstruction robustness. Its core idea is to integrate perceptual enhancement features... Remapping to the original space - channel co-enhanced features Within a reasonable dynamic range, this avoids distribution shifts and visual artifacts introduced by semantic masks. To avoid numerical distribution drift, it ensures that the global distribution of enhanced features remains consistent with the original features.
[0149] The following formula will be used to enhance perceptual features. Remapping to the original space - channel co-enhanced features The dynamic range is used to obtain the mapping enhancement features. :
[0150] ;
[0151] ;
[0152] in, To enhance the mapping features, it ensures that after introducing advanced semantic priors to focus on and enhance key target regions, the overall distribution of features remains stable and controllable, avoiding visual distortion caused by over-enhancement. for The offset, To prevent division by zero anomalies, this value is uniformly adopted in this invention. To ensure consistency in visual perception, this invention calculates mapping enhancement features based on statistical constraints. The mean and standard deviation are used, and outlier filtering is performed using three times the standard deviation as a reasonable range:
[0153] , ;
[0154] in, and These are respectively mapping enhancement features The mean and standard deviation of the image are used. Outlier filtering ensures the enhanced image is within a reasonable range, ultimately resulting in accurate perceptual enhancement features.
[0155] ;
[0156] in, To enhance the mapping features Functions restricted to a specified range.
[0157] In some embodiments, S300, the step of inputting the precise perception enhancement features to the feature reconstruction module and generating a texture enhancement feature map through a progressive channel compression structure and a residual network includes:
[0158] S301, the precise perception enhancement features are processed through a progressive channel compression structure to obtain preliminary reconstructed features; the progressive channel compression structure includes four convolutional modules connected in sequence, wherein the first three convolutional modules are each composed of a 3×3 convolutional kernel and a ReLU activation function, and the fourth convolutional module is composed of a 3×3 convolutional kernel and a Sigmoid activation function;
[0159] S302, the precise perception enhancement features are input into the residual network, the precise perception enhancement features are convolved using 1×1 convolution, and nonlinear mapping is performed through the Sigmoid activation function to generate residual compensation features whose numerical range is consistent with the initial reconstructed features.
[0160] S303, the preliminary reconstructed features and the residual compensation features are added pixel by pixel to obtain a texture enhancement feature map.
[0161] To enhance the final perceptual features To reconstruct a three-channel image and achieve high-quality underwater image enhancement, this invention designs a Feature Reconstruction Module (FRM). This module employs a progressive channel compression structure consisting of four convolutional layers and introduces a sigmoid activation function to achieve a mapping from abstract features to pixel space.
[0162] ;
[0163] in, Both indicate that they are made by one A module consisting of convolutional kernels and the ReLU activation function, and By one It consists of a convolution kernel and a sigmoid activation function.
[0164] Furthermore, to avoid the loss of detailed information during the reconstruction process, this invention introduces a feature reconstruction module... Residual networks constructed using convolutions:
[0165] ;
[0166] in, express Convolution operation, (·) is the Sigmoid activation function. Its output is added pixel-by-pixel to the main branch features to construct a channel that preserves the original information, thereby achieving accurate reconstruction from features to a three-channel image.
[0167] ;
[0168] in, This is the texture enhancement feature map obtained after reconstruction. , These represent the initial reconstructed features generated after the main branch undergoes progressive convolution operations and the compensation features generated by the residual network, respectively.
[0169] In some embodiments, S400, determining the gradient magnitude weight based on the difference in gradient field distribution between the texture enhancement feature map and the color correction feature map, and then using the gradient magnitude weight to perform weighted fusion of the texture enhancement feature map and the color correction feature map to generate an enhanced image includes:
[0170] S410 uses the Scharr operator to calculate the gradient field distribution of the texture enhancement feature map and the color correction feature map respectively, and obtains the gradient magnitude feature map through square root operation.
[0171] Specifically, the gradients of the texture enhancement feature map and the color correction feature map are calculated in the horizontal and vertical directions using the Scharr operator convolution kernel to obtain the gradient responses in the two directions. The gradient responses in the horizontal and vertical directions are combined based on the square root operation to generate the gradient magnitude feature map of the texture enhancement feature map and the color correction feature map.
[0172] S420, Gaussian smoothing is performed on the gradient magnitude feature map to suppress noise and preserve edge structure, resulting in a smoothed gradient magnitude map.
[0173] S430 normalizes the smoothed gradient magnitude map and amplifies the gradient differences between regions by exponential amplification to generate gradient magnitude weights.
[0174] Specifically, the normalized gradient magnitude feature map is exponentially amplified, and the significance of gradient differences is adjusted by preset weight parameters. Based on the exponentially amplified gradient magnitude feature map, the initial spatial weight maps of the texture enhancement branch and the color correction branch are calculated to ensure that the information features of high gradient regions are preserved first.
[0175] S440, a balance factor is introduced to interpolate and fuse the gradient magnitude weights to obtain the fusion weights of the texture enhancement branch and the color correction branch;
[0176] S450, the texture enhancement feature map and color correction feature map are weighted and fused pixel by pixel using the fusion weight, and the fusion result is limited to a preset range by the pixel value truncation function to generate an enhanced image.
[0177] To balance perceptual enhancement and color correction, and to maintain focus on key target regions while preserving color topology, this invention proposes a dual-branch fusion strategy based on gradient field modulation (Gradient Attention Module, GAM). This strategy involves analyzing the texture enhancement feature maps output by the texture enhancement branch and the color correction branch. With color correction feature map The gradient field distribution differences are used to generate a content-aware spatial weight map, achieving synergistic optimization of edge structure preservation and color topology. This invention uses the input image... Convert to grayscale image Perform gradient calculations, where k=1,2, and the input image is... This is a three-channel image, representing texture enhancement feature maps. With color correction feature map grayscale image This is the corresponding single-channel image. Local gradient information is extracted in both the horizontal and vertical directions using the Scharr operator:
[0178] ;
[0179] in, and This is the Scharr operator convolution kernel. Based on the gradient responses in the two directions mentioned above, this invention further obtains the overall gradient magnitude feature map of the image through square root operations. :
[0180] , ;
[0181] Where * denotes a two-dimensional convolution operation. This is due to the gradient magnitude feature map. The original design exhibits weak anti-interference capabilities, making it susceptible to noise and detail interference. This can lead to abrupt changes in the weight matrix and the generation of blocky artifacts, resulting in a blocky effect in the fusion result that disrupts visual coherence. To address this, this invention employs Gaussian smoothing based on a normal distribution to suppress noise while preserving edge structures, making gradient changes more continuous and ensuring a smooth transition in the weight map.
[0182] , ;
[0183] in, This represents the smoothed gradient magnitude plot. This is the original gradient magnitude map, where (x, y) are Gaussian kernel coordinates. The standard deviation of the Gaussian kernel is denoted as . The smoothed gradient magnitude feature map can more accurately reflect the distribution of gradient information in the image, thus more effectively directing attention to focus on key regions.
[0184] High gradient regions typically correspond to key information such as image edges and texture details; therefore, information features from these regions should be preserved preferentially during the fusion process. This invention first processes the smoothed gradient magnitude map... Normalization is performed to map the gradient intensities of different images to a uniform interval, resulting in a normalized gradient. Subsequently, to prioritize preserving the information features of high-gradient regions, this invention will... Perform exponential scaling and set weight parameters. This amplifies the gradient differences between regions. Finally, the gradient magnitude weights are obtained by normalizing the images output from the texture enhancement branch and the color correction branch. The above steps utilize gradient magnitude weights at the pixel level. The outputs of the two branches are normalized to suppress the excessive dominance of a single branch during the fusion process and ensure a relative balance in the contributions of the two branches. The specific calculation is as follows:
[0185] ;
[0186] ;
[0187] in, , Weighting parameters are used to prevent division by zero errors. This is used to more significantly amplify gradient differences between regions, thereby better preserving the information features of high-gradient regions.
[0188] However, gradient magnitude weights constructed directly based on gradient magnitude The distribution often exhibits an overly extreme pattern, with some regions approaching 0 or 1. This causes the attention weights to overemphasize these regions, neglecting the overall balance. To mitigate this issue, this invention further introduces a balance factor during the weight generation stage. Simultaneously, attention weights are interpolated and fused with a uniformly distributed weight of 0.5. This mechanism effectively suppresses excessive weight bias, allowing the fusion process to fully utilize gradient features while maintaining the smoothness and stability of the results.
[0189] , ;
[0190] in, and These are the fusion weights for the texture enhancement branch and the color correction branch, respectively, satisfying... Ultimately, based on and This enables image fusion of the texture enhancement branch and the color correction branch.
[0191] ;
[0192] in, This is a pixel value truncation function used to restrict the pixel values of the merged image to the range [0, 255]. and These are the output results of the texture enhancement branch and the color correction branch, respectively. This represents element-wise multiplication, where Y is the enhanced image after fusion.
[0193] In some embodiments, S500, the step of training and optimizing the perception-driven underwater image enhancement network using the loss function value between the enhanced image and the corresponding reference ground image to obtain the underwater image enhancement model includes:
[0194] S510, calculates the absolute error between the enhanced image and the reference ground image at each pixel and each channel;
[0195] S520: The absolute error values of all pixels are averaged based on the height, width and number of channels of the image to obtain the L1 norm loss function value.
[0196] S530 uses the backpropagation algorithm to update the model parameters of the perception-driven underwater image enhancement network based on the L1 norm loss function value until the preset convergence condition is met or the maximum number of iterations is reached, thus obtaining the underwater image enhancement model.
[0197] It should be noted that underwater images are often affected by physical effects such as light scattering and absorption, leading to strong noise and pixel abrupt changes in local areas (such as the brightness difference between the edge of a foreground object and the background water). Therefore, this invention uses the L1 norm loss function (Mean Absolute Error, MAE) as the core optimization objective. Compared to L2 loss, L1 loss is more robust to outliers, and can robustly constrain the model to learn realistic scene details while suppressing the influence of noise and pixel abrupt changes, thereby significantly improving the credibility of the overall enhancement results.
[0198] ;
[0199] Where H, W, and C correspond to the height, width, and number of channels of the image, respectively. Represents the predicted enhanced image. For the reference ground truth image, i, j, and k are the indices of the corresponding image in the height, width, and channel dimensions, respectively; This represents the calculated L1 norm loss function value.
[0200] This invention proposes a perceptual enhancement-based multi-branch underwater image enhancement network, PFHE-GAN, whose core architecture comprises two collaboratively optimized processing paths: a texture enhancement branch based on generative adversarial learning (GAN) and an adaptive color correction branch. The texture enhancement branch, serving as the backbone, first undergoes global enhancement via a baseline GAN network and then introduces a perceptual-guided attention module and a feature reconstruction module. Shallow convolutional kernels capture edge and texture features within the small-scale receptive field, effectively mitigating low-frequency detail degradation caused by underwater scattering. Building upon this, a spatial-channel collaborative attention module (spatial-channel collaborative attention module) is introduced to strengthen the representation of key region features. Furthermore, a semantic segmentation mask is innovatively integrated as a priori for human visual perception, guiding attention weights to dynamically focus on the target subject, achieving targeted optimization of both background and subject. This branch combines the weight map of the spatial-channel collaborative attention module with mask features through a pixel-level weighted fusion strategy, constructing a collaborative optimization framework for human perception and machine attention. Meanwhile, the color correction branch uses a histogram color correction module (HCCM) to process the underwater image before inputting it into a baseline generative adversarial network (GAN) for supplementary enhancement. An adaptive thresholding mechanism drives a piecewise linear mapping function, dynamically adapting to different water quality conditions while preserving the original color topology, effectively avoiding oversaturation distortion. The dual paths achieve content complementarity through independent forward propagation and gradient-guided feature fusion strategies, ultimately generating an enhanced image that conforms to human visual perception characteristics. Figure 7 As shown.
[0201] To verify the improvement effect of the present invention, experiments were conducted by comparing the most advanced and representative methods, including: U-Shape, Water-Net, CycleGAN, FUnIE-GAN, HAAM-GAN, Udnet, RAUNE-Net, and HUWIE-Net.
[0202] The table below presents the performance comparison results on the widely used UIEB dataset. Based on the paired reference images provided by this dataset, we performed four full-reference image quality evaluations on the augmentation results. Quantitative analysis shows that the proposed method exhibits state-of-the-art comprehensive performance: achieving a PSNR of 24.55 dB, a 4.8% improvement over the second-best method, HUWIE-Net; and leading all comparative methods in terms of structural similarity (SSIM). In the Visual Saliency Index (VSI) evaluation, the proposed method outperforms all competing schemes with a score of 0.9768. Although HAAM ranks first in the FSIM index with 0.9352, the proposed method remains highly competitive and significantly outperforms the other comparative methods. Notably, compared to classic GAN methods, the proposed scheme shows a significant advantage, with a PSNR improvement of 6.34 dB over CycleGAN and 5.08 dB over FUNIE. These results collectively validate that the proposed method can effectively improve multi-dimensional visual perception quality while maintaining structural integrity.
[0203] Table 2: Performance comparison results of various methods on the UIEB dataset;
[0204]
[0205] To further verify the robustness of the proposed method, we conducted additional experiments on UFO120, EUVP, and LSUI datasets, with results shown in the table below. These three datasets exhibit more complex degradation characteristics compared to the standard test set. UFO120 includes extreme lighting variations, EUVP covers large-scale real-world underwater environments, and LSUI features high turbidity. The table below lists the no-reference evaluation results of the proposed method and state-of-the-art methods on these datasets. The proposed method demonstrates excellent generalization ability in cross-dataset tests, achieving the best performance in both UIQM and UCIQE on the UFO-120 dataset. On the EUVP dataset, the UCIQE score is second only to Udnet, while the UIQM score is slightly lower than CycleGAN (0.09 difference). On the most challenging LSUI dataset, the proposed method achieves a comprehensive lead in both metrics with a UIQM of 3.035 and a UCIQE of 0.6125. Of particular note is that the method proposed in this invention is the only one to achieve a UCIQE score exceeding 0.61 on all three datasets, with the UIQM value consistently remaining above 2.95, significantly outperforming the performance fluctuations observed in turbid scenarios by methods such as Water-Net and RAUNE-Net. These results fully demonstrate the adaptability of the proposed method to complex underwater environments and the consistency of its metrics.
[0206] Table 3: No-reference evaluation results on different datasets;
[0207]
[0208] The U45 dataset contains classification test subsets for different types of color cast degradation: green cast, blue cast, and hazy degradation. This dataset effectively evaluates the performance of various methods in specific color enhancement tasks. As shown in the table below, the proposed method exhibits excellent performance in different color cast scenarios. For the green cast scenario, it significantly outperforms HUWIE-Net with a UIQM of 3.258 and a UCIQE of 0.6106. In the blue cast scenario, although FUNIE achieves the highest UIQM, the proposed method lags behind by only 0.06, achieving the best overall performance with a balanced UIQM and UCIQE. For the hazy degradation scenario, the proposed method refreshes the benchmark with a UIQM of 3.456, and its UCIQE is comparable to the best method, HUWIE-Net. Notably, the proposed method is the only method that achieves a UIQM exceeding 3.0 in all three degradation scenarios, and its color correction stability is significantly better than the fluctuating performance of methods such as Udnet. These results validate the effective adaptability of the proposed method to water degradation characteristics under different color deviation types.
[0209] Table 4: No reference evaluation results for each method under different color cast types in the U45 dataset;
[0210]
[0211] Compared with related technologies, the present invention has the following advantages:
[0212] This invention proposes a multi-branch architecture for a perception-driven underwater image enhancement network. The texture enhancement branch focuses on the restoration of degraded texture features and detail reconstruction. The color correction branch, based on an adaptive histogram correction mechanism, implements physically-guided color restoration to address underwater color cast issues.
[0213] This invention proposes a perception-guided attention module, which, by coupling a semantic segmentation mask with a spatial channel collaborative attention module, dynamically embeds prior human visual perception into the feature optimization process, significantly improving the ability to focus on key underwater target areas.
[0214] This invention proposes a gradient modulation-based dual-branch fusion strategy. By dynamically analyzing the difference in feature gradient distribution between the texture enhancement branch and the color correction branch, an adaptive weight mapping function is constructed to achieve a balance between maintaining the edge structure and the color topology while suppressing feature conflicts.
[0215] The PFHE-GAN proposed in this invention constructs a modular enhancement framework. Through its separable architecture design, it achieves broad compatibility with existing underwater image enhancement baseline networks and can integrate additional semantic information into the network, thereby significantly improving the image enhancement performance.
[0216] This invention also provides an underwater image enhancement system based on a perception-guided mechanism, comprising:
[0217] At least one processor;
[0218] At least one memory for storing at least one program;
[0219] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.
[0220] The content of the above method embodiments is applicable to this embodiment. The specific functions implemented in this embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments. Therefore, they will not be repeated here.
[0221] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0222] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0223] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0224] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0225] This invention also provides a computer program product, including a computer program or computer instructions, which are stored in a memory. A processor of a computer device reads the computer program or computer instructions from the memory and executes the computer program or computer instructions, causing the computer device to perform the above-described method.
[0226] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0227] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0228] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0229] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
Claims
1. An underwater image enhancement method based on a perception-guided mechanism, characterized in that, The method includes the following steps: S100: Acquire underwater images as training samples and input them into a multi-branch architecture perception-driven underwater image enhancement network, which includes a texture enhancement branch and an adaptive color correction branch. S200, in the adaptive color correction branch, performs color correction processing on underwater images to generate color correction feature maps; In the texture enhancement branch, the S300 performs feature extraction and mapping enhancement processing on underwater images to generate accurate perception enhancement features. The accurate perception enhancement features are then input into the feature reconstruction module, which generates texture enhancement feature maps through a progressive channel compression structure and a residual network. S400 determines the gradient magnitude weight based on the difference in gradient field distribution between the texture enhancement feature map and the color correction feature map, and uses the gradient magnitude weight to perform weighted fusion of the texture enhancement feature map and the color correction feature map to generate an enhanced image; S500: The perception-driven underwater image enhancement network is trained and optimized by the loss function value between the enhanced image and the corresponding reference ground image to obtain the underwater image enhancement model; the underwater image enhancement model is used to enhance the underwater image to be enhanced and output the corresponding enhanced image. In S300, the texture enhancement branch performs feature extraction and mapping enhancement processing on the underwater image to generate accurate perception enhancement features, including: S310, globally enhance the input underwater image to obtain a globally enhanced image; S320, The global enhanced image is simultaneously input to the parallel feature extraction module and semantic segmentation module to extract basic visual semantic features and generate a semantic segmentation mask, respectively; S330, The basic visual semantic features are input into the spatial-channel collaborative attention module, and spatial-channel collaborative enhanced features are generated through the collaborative optimization of spatial attention and channel attention; S340, the semantic segmentation mask and the spatial-channel collaborative enhancement feature are fused pixel by pixel, and the influence of the mask is adjusted by an adjustable weight coefficient to generate perceptual enhancement features; S350, The perception mapping module is used to perform dynamic range remapping and outlier filtering on the perception enhancement features to generate accurate perception enhancement features; In S300, the step of inputting the precise perception enhancement features into the feature reconstruction module and generating a texture enhancement feature map through a progressive channel compression structure and a residual network includes: S301, the precise perception enhancement features are processed through a progressive channel compression structure to obtain preliminary reconstructed features; the progressive channel compression structure includes four convolutional modules connected in sequence, wherein the first three convolutional modules are each composed of a 3×3 convolutional kernel and a ReLU activation function, and the fourth convolutional module is composed of a 3×3 convolutional kernel and a Sigmoid activation function; S302, the precise perception enhancement features are input into the residual network, the precise perception enhancement features are convolved using 1×1 convolution, and nonlinear mapping is performed through the Sigmoid activation function to generate residual compensation features whose numerical range is consistent with the initial reconstructed features. S303, the preliminary reconstructed features and the residual compensation features are added pixel by pixel to obtain a texture enhancement feature map.
2. The method according to claim 1, characterized in that, In step S200, the step of performing color correction processing on the underwater image to generate a color correction feature map includes: S210, determine the cumulative histogram of the underwater image, and determine the dark threshold and bright threshold through preset truncation parameters; S220, the pixel values of each channel are truncated based on the dark threshold and the bright threshold, and the truncated pixel values are linearly expanded to a preset range through a mapping formula to generate corrected single-channel image data; the mapping formula is a piecewise linear function, which is used to perform different linear mapping processes on pixel values below the dark threshold, above the bright threshold, and in between, to map the pixel values from the original range to the target range. S230 merges the corrected single-channel image data into a multi-channel image and inputs it into the generative adversarial network to generate the corresponding color correction feature map.
3. The method according to claim 1, characterized in that, In S320, the step of simultaneously inputting the global enhanced image into the parallel feature extraction module and semantic segmentation module to extract basic visual semantic features and generate a semantic segmentation mask includes: In the feature extraction module, the basic visual semantic features of the global enhanced image are gradually extracted through two consecutive 3×3 convolution operations and the ReLU activation function. In the semantic segmentation module, a encoder-decoder structure is used to perform pixel-level classification of the globally enhanced image, generating a semantic segmentation mask with the same resolution as the underwater image.
4. The method according to claim 1, characterized in that, In S330, the basic visual semantic features are input into the spatial-channel collaborative attention module, and spatial-channel collaborative enhanced features are generated through the collaborative optimization of spatial attention and channel attention, including: S331, In the spatial attention stage, attention weights in the horizontal and vertical directions are calculated by depthwise separable convolution and group normalization, respectively. S332, Based on the attention weights in the horizontal and vertical directions, the basic visual semantic features are subjected to bidirectional spatial attention weighting to generate spatially enhanced features; S333, in the channel attention stage, channel attention weights are generated by performing average pooling and multi-head self-attention calculation on spatial enhancement features; S334, apply the channel attention weights to the spatial enhancement features after average pooling to generate spatial-channel co-enhanced features.
5. The method according to claim 1, characterized in that, In step S400, the step of determining gradient magnitude weights based on the difference in gradient field distribution between the texture enhancement feature map and the color correction feature map, and then using these gradient magnitude weights to perform weighted fusion of the texture enhancement feature map and the color correction feature map to generate an enhanced image includes: S410 uses the Scharr operator to calculate the gradient field distribution of the texture enhancement feature map and the color correction feature map respectively, and obtains the gradient magnitude feature map through square root operation. S420, Gaussian smoothing is performed on the gradient magnitude feature map to suppress noise and preserve edge structure, resulting in a smoothed gradient magnitude map. S430 normalizes the smoothed gradient magnitude map and amplifies the gradient differences between regions by exponential amplification to generate gradient magnitude weights. S440, a balance factor is introduced to interpolate and fuse the gradient magnitude weights to obtain the fusion weights of the texture enhancement branch and the color correction branch; S450, the texture enhancement feature map and color correction feature map are weighted and fused pixel by pixel using the fusion weight, and the fusion result is limited to a preset range by the pixel value truncation function to generate an enhanced image.
6. The method according to claim 1, characterized in that, In S500, the underwater image enhancement model is obtained by training and optimizing the perception-driven underwater image enhancement network using the loss function value between the enhanced image and the corresponding reference ground image, including: S510, calculates the absolute error between the enhanced image and the reference ground image at each pixel and each channel; S520: The absolute error values of all pixels are averaged based on the height, width and number of channels of the image to obtain the L1 norm loss function value. S530 uses the backpropagation algorithm to update the model parameters of the perception-driven underwater image enhancement network based on the L1 norm loss function value until the preset convergence condition is met or the maximum number of iterations is reached, thus obtaining the underwater image enhancement model.
7. An underwater image enhancement system based on a perception-guided mechanism, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method as described in any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Deep learning underwater image enhancement method based on embedded multi-feature fusion
CN115034981A
Auto-labeling systems and applications for open-set and out-of-domain segmentation
US20250029409A1