An underwater image enhancement method based on semantic guidance and degradation consistency

CN122928679APending Publication Date: 2026-10-16福州海洋研究院
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611107275.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

然而,现有方案中的语义信息多作为附加注意力、辅助损失或简单连接特征使用,语义区域与退化估计、频率选择性恢复及空间融合之间仍缺少统一的对应关系;任务感知微调还可能使增强网络偏向语义指标而产生颜色漂移、过锐化或曝光异常

Benefits of technology

[0087] 1. By using a semantic prior network with fixed parameters, dense semantic responses are converted into foreground soft gating, boundary soft gating, and background soft gating, enabling the augmentation network to obtain stable semantic region coordinates. Continuous soft gating is used to process blurred target boundaries and turbid transition regions, avoiding the augmentation network's reliance on precise semantic category labels, and achieving region-sensitive augmentation for foreground targets, boundary structures, and water background.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122928679A_ABST
    Figure CN122928679A_ABST
Patent Text Reader

Abstract

The application relates to an underwater image enhancement method based on semantic guidance and degradation consistency, and belongs to the technical fields of underwater image enhancement and computer vision. The method adopts a DINOv3 semantic prior network with fixed parameters to extract dense semantic responses and intermediate semantic features, and generates three types of soft gates of foreground, boundary and background in combination with image gradients; scale and bias modulation is performed on the degraded features by using the intermediate semantic features, and independent bounded prediction heads are used to construct decay, transmission, illumination, structural degradation and background light pseudo-physical degradation conditions; two types of candidate images are generated through a region-guided color restoration branch and a semantic perception wavelet restoration branch, and an enhanced image is obtained through pixel-by-pixel fusion gating adaptive fusion based on a fusion condition tensor; finally, a two-stage strategy of grouping supervision and quality anchor playback is adopted to train the model, and the model is adapted to the scene of single underwater image enhancement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of underwater image enhancement and computer vision technology, and particularly relates to an underwater image enhancement method based on semantic guidance and degradation consistency. Background Technology

[0002] Underwater light propagation is affected by selective absorption, scattering, suspended particles, and non-uniform illumination. Different wavelengths of light exhibit varying attenuation rates, easily leading to underwater images appearing bluish-green, locally fogged, with reduced contrast, weakened texture, and blurred target edges. These degradations not only affect human visual observation but also weaken the semantic and geometric cues required for underwater semantic segmentation, target detection, and environmental perception. Because water conditions, imaging distance, illumination distribution, and scene content can all vary, underwater image degradation is typically not spatially uniform.

[0003] Existing underwater image enhancement methods include traditional enhancement methods based on histograms and color constancy, physical restoration methods based on underwater imaging models, and learning methods based on convolutional neural networks, Transformers, generative networks, and diffusion models. Traditional enhancement methods typically improve appearance through global contrast stretching or color compensation, but struggle to accurately distinguish between targets and the water background. Physical methods rely on estimates of transmittance, background light, or water parameters, and are easily affected by non-uniform lighting and mixed water bodies under single-image conditions. Learning methods can establish a mapping from degraded images to reference images, but most still aim for uniform restoration of the entire image.

[0004] Different regions in underwater scenes have different restoration requirements. Water background areas typically suffer from color shifts, occlusion, and uneven illumination, requiring strong low-frequency color and illumination correction. Foreground objects and object boundaries, on the other hand, need to maintain texture, contours, and semantic structure; excessive global correction or uniform sharpening may cause object color distortion, overly smoothed contours, increased background noise, or alterations to task-related details. Therefore, determining restoration intensity solely based on low-level color and gradient information makes it difficult to distinguish regions with statistically similar colors but different semantic attributes.

[0005] In recent years, methods have been introduced into underwater image enhancement by incorporating semantic attention, collaborative learning, or downstream task constraints. Other methods utilize frequency domain decomposition or physical priors to process color, lighting, and structural information separately. However, semantic information in existing schemes is mostly used as additional attention, auxiliary loss, or simple connectivity features. There is still a lack of a unified correspondence between semantic regions and degradation estimation, frequency-selective restoration, and spatial fusion. Furthermore, task-aware fine-tuning may cause the enhancement network to be biased towards semantic indicators, resulting in color drift, oversharpening, or exposure anomalies.

[0006] To bridge this gap, this invention transforms dense semantic priors with fixed parameters into soft gating of foreground, boundary, and background for restoration. The soft gating and semantic features are used to construct pseudo-physical degradation conditions, so that low-frequency color illumination restoration, high-frequency structure restoration, and pixel-by-pixel fusion of the two candidate results all conform to the local semantic region and degradation state. At the same time, visual quality drift caused by task perception fine-tuning is suppressed through group supervision and quality anchor playback. Summary of the Invention

[0007] The purpose of this invention is to provide an underwater image enhancement method based on semantic guidance and degradation consistency. The underwater image enhanced by this method can adaptively select color, lighting and structure restoration intensity according to different degradation states of foreground targets, target boundaries and water background. While improving color distortion, low contrast and structural blur, it maintains semantic and boundary information useful for downstream perception tasks.

[0008] To achieve the above objectives, the technical solution of this invention is: an underwater image enhancement method based on semantic guidance and degradation consistency. This method employs semantic region segmentation, degradation condition construction, degradation consistency dual-branch recovery, adaptive fusion, and a group optimization approach combined with quality anchor playback. It converts the dense semantic response extracted by a semantic prior network with fixed parameters into foreground soft gating, boundary soft gating, and background soft gating. The degradation features of the underwater image are modulated using these soft gating and intermediate semantic features to construct attenuation representation, transmission representation, illumination representation, structural degradation representation, and background light representation. Low-frequency color and illumination recovery and high-frequency structural recovery are performed based on the degradation conditions, and the two recovery results are fused pixel-by-pixel according to the local semantic region and degradation state. The degradation consistency refers to the spatial correspondence between semantic region soft gating, pseudo-physical degradation conditions, recovery response, and fusion weights. This ensures that areas with strong water background, color shift, or scattering receive relatively strong color and illumination correction, while foreground targets and boundary regions receive relatively strong structural preservation recovery, avoiding the application of the same recovery intensity to the entire image. The method is used to enhance a single underwater image to be enhanced. By making semantic region gating, pseudo-physical degradation conditions, recovery response and fusion weights spatially correspond to each other, it improves color shift, scattering fog, illumination imbalance and structural blur while maintaining the appearance, boundary and task-related texture of the target. The specific steps include the following.

[0009] S1. Obtain the underwater image to be enhanced. Use a semantic prior network with fixed parameters to extract the dense semantic response and intermediate semantic features of the underwater image to be enhanced. After feature concatenation of the intermediate semantic features with the image gradient of the underwater image to be enhanced, the foreground soft gate, boundary soft gate and background soft gate are generated through lightweight convolutional mapping and Sigmoid activation function.

[0010] S2. Encode the underwater image to be enhanced and its image gradient to obtain low-level degradation features. Use the intermediate semantic features to perform multiplicative scaling and additive bias modulation on the low-level degradation features in sequence. Based on the modulated degradation features, predict the attenuation characterization, transmission characterization, illumination characterization, structural degradation characterization and background light characterization respectively through mutually independent bounded prediction heads to form pseudo-physical degradation conditions.

[0011] S3. A degradation-consistent dual-branch recovery network is used to recover the underwater image to be enhanced: the color recovery branch connects the underwater image to be enhanced, attenuation characterization, transmission characterization, illumination characterization, and background light characterization to obtain a color conditional tensor, predicts the color residual based on the color conditional tensor, and calculates the color recovery candidate image by combining foreground soft gating and background soft gating; the semantic-aware wavelet recovery branch performs wavelet decomposition on the underwater image to be enhanced to obtain a low-frequency sub-band and multiple high-frequency sub-bands, corrects the low-frequency sub-band based on background soft gating and transmission characterization, and corrects the high-frequency sub-band based on boundary soft gating, foreground soft gating, and structural degradation characterization, and obtains the wavelet recovery candidate image after inverse wavelet transform and spatial residual refinement;

[0012] S4. The underwater image to be enhanced, the candidate image for color restoration, the candidate image for wavelet restoration, the transmission characterization, the structural degradation characterization, the image gradient, the foreground soft gate, the boundary soft gate, and the background soft gate are connected by feature concatenation to obtain a fusion condition tensor. A pixel-wise fusion gate is generated based on the fusion condition tensor. The candidate image for color restoration and the candidate image for wavelet restoration are weighted and fused according to the pixel-wise fusion gate to obtain the enhanced underwater image.

[0013] Furthermore, in step S1, the semantic prior network includes a DINOv3 backbone network with fixed parameters and a lightweight dense decoder. The lightweight dense decoder is adapted based on underwater semantic annotation data before the augmentation network is trained. During the training process, the parameters of the DINOv3 backbone network remain fixed, and the loss of the augmentation network does not backpropagate gradients to the semantic prior network.

[0014] The semantic prior extraction process is calculated using the following formula:

[0015] (Ps, Fs) = Tφ(I)

[0016] Where I is the underwater image to be enhanced, Tφ is the semantic prior extractor with fixed parameters, and Ps∈R H×W×K Let Fs ∈ R be the dense semantic response corresponding to K semantic categories. cs×H×W The compact intermediate semantic features are the output of the lightweight dense decoder before the final classifier. H and W are the height and width of the underwater image to be enhanced, respectively. K is the total number of semantic categories, and cs is the number of channels of the intermediate semantic features.

[0017] The overall processing procedure of the semantic prior network is calculated by the following formula:

[0018] Zs=Bφ(I), (Ps, Fs)=Up(Hs(Zs))

[0019] Wherein, Bφ() is the DINOv3 backbone network with fixed parameters, Zs is the block-level basic features extracted by the backbone network, Hs is the lightweight dense decoder, and Up is the upsampling operation that scales the dense response to the spatial resolution of the underwater image to be enhanced.

[0020] Furthermore, in step S2, the multiplicative scaling modulation and additive bias modulation are calculated using the following formulas:

[0021] =Fd⊙(1+ρtanh(Γ(Fs)))+ρtanh(Δ(Fs))

[0022] in, Fd represents the low-level degenerate features, ⊙ represents element-wise multiplication, ρ represents the preset or learnable semantic modulation intensity, Γ represents the semantic scale prediction mapping, Δ represents the semantic bias prediction mapping, Fs represents the intermediate semantic features, and tanh represents the hyperbolic tangent activation function.

[0023] Furthermore, in step S2, the pseudo-physical degradation condition is calculated using the following formula:

[0024] P={β, t, L, S, B∞, ▽I}

[0025] Where β is the color degradation characterization in the form of attenuation, t is the visibility characterization in the form of transmission, L is the illumination distribution characterization, S is the structural degradation characterization, B∞ is the background light characterization, and ▽I is the image gradient of the underwater image to be enhanced.

[0026] The predictions for each pseudo-physical degradation condition are calculated using the following formula:

[0027] β=σ(Hβ( ))

[0028] t=σ(Ht( ))

[0029] L=σ(HL( ))

[0030] S=σ(HS( ))

[0031] B∞=σ(HB(GAP( )))

[0032] Where σ is the Sigmoid activation function, Hβ, Ht, HL, HS, and HB are independent prediction heads for attenuation characterization, transmission characterization, illumination characterization, structural degradation characterization, and background light characterization, respectively, and GAP is the global average pooling operation.

[0033] The values ​​and dimensions of each representation satisfy: β∈[0,1] H×W×3 t, L, S ∈ [0, 1] H×W×1 B∞∈[0,1] 1×1×3 The background light characterizes the spatial resolution of the underwater image to be enhanced during use.

[0034] Furthermore, in step S3, the processing of the color restoration branch is calculated using the following formula:

[0035] Formula for constructing the color condition tensor:

[0036] Xc = [I, β, t, L, B∞]

[0037] Where Xc is the color condition tensor, I is the underwater image to be enhanced, [⋅] represents the feature connection operation, β is the color degradation characterization in the form of attenuation, t is the visibility characterization in the form of transmission, L is the illumination distribution characterization, and B∞ is the background light characterization.

[0038] Formula for predicting color residuals:

[0039] Δc=Rc([I, β, t, L, B∞])

[0040] Where Δc is the bounded three-channel color residual, and Rc is the color residual prediction mapping;

[0041] Formula for calculating color restoration region gain:

[0042] Ac = Ac(Gbg, Gf)

[0043] Where Ac is the color recovery region gain, Gbg is the background soft gating, and Gf is the foreground soft gating;

[0044] Formula for generating candidate images for color restoration:

[0045] Jc=clip(I+ηc·Ac⊙Δc,0,1)

[0046] Where Jc is the candidate image for color restoration, ηc is the preset or learnable color residual intensity, and clip is the clipping operation that restricts the output value to the range of [0,1].

[0047] Furthermore, in step S3, the processing procedure of the semantically aware wavelet recovery branch is calculated using the following formula:

[0048] Wavelet decomposition formula:

[0049] (ILL, ILH, IHL, IHH) = Dw(I)

[0050] Where I represents the underwater image to be enhanced, Dw represents the wavelet decomposition operation, ILL represents the low-frequency subband containing coarse-grained color and illumination information, and ILH, IHL, and IHH represent the high-frequency subbands containing edge and texture responses in different directions. The high-frequency subbands are spliced ​​together to form IHF=[ILH,IHL,IHH].

[0051] Low-frequency subband correction formula:

[0052] ALL = ALL(Gbg, t)

[0053] =ILL+ηLL·ALL⊙RLL([ILL,t,L,Gbg])

[0054] Where ALL represents low-frequency recovery gating, ηLL represents preset or learnable low-frequency residual intensity, RLL represents low-frequency residual mapping, t represents visibility characterization in transmission form, and L represents illumination distribution characterization. This is the corrected low-frequency sub-band;

[0055] High-frequency subband correction formula:

[0056] AHF = AHF(Gb, Gf)

[0057] =IHF+ηHF·AHF⊙RHF([IHF,Gf,Gb,S])

[0058] Where AHF is high-frequency recovery gating, Gb is boundary soft gating, ηHF is preset or learnable high-frequency residual intensity, and RHF is high-frequency residual mapping. The high-frequency subband is the corrected value, and S represents the structural degradation characterization.

[0059] Inverse wavelet transform formula:

[0060] Jw 0 =Dw -1 ( , , , )

[0061] Among them, Jw 0 For the initial wavelet reconstruction image, Dw -1 This is an inverse wavelet transform operation. , , These are the corrected high-frequency subbands containing edge and texture responses in different directions;

[0062] Spatial refinement gating calculation formula:

[0063] Aw=Aw([Jw 0 ,S,▽I,Gf,Gb])

[0064] Among them, Aw is the spatial refinement gating;

[0065] The formula for generating candidate images using wavelet recovery is as follows:

[0066] Jw=clip(Jw 0 +ηw·Aw⊙Rs([I,Jw 0 ,Aw]), 0,1)

[0067] Where Jw is the wavelet-restored candidate image, ηw is the preset or learnable spatial residual thinning intensity, Rs is the spatial residual thinning map, and clip is the clipping operation that restricts the output value to the range [0,1].

[0068] Furthermore, in step S4, the fusion process is calculated using the following formula:

[0069] Formula for constructing the fusion conditional tensor:

[0070] Xf=[I,Jc,Jw,t,S,▽I,Gf,Gb,Gbg]

[0071] Where Xf is the fusion condition tensor, I is the underwater image to be enhanced, Jc is the color restoration candidate image, Jw is the wavelet restoration candidate image, t is the visibility representation in the form of transmission, S is the structural degradation representation, ▽I is the image gradient of the underwater image to be enhanced, Gf is the foreground soft gate, Gb is the boundary soft gate, and Gbg is the background soft gate.

[0072] The formula for calculating pixel-by-pixel fusion gate:

[0073] α=σ(Conv1×1 (Φf(Xf)))

[0074] Where α∈[0,1] H×W The wavelet recovery candidate image is fused at each pixel position. Conv1×1 is a 1×1 convolution operation, and Φf is a shallow spatial mapping composed of convolution blocks and residual blocks.

[0075] Formula for generating enhanced underwater images:

[0076] =α⊙Jw+(1-α)⊙Jc

[0077] in, To enhance underwater images.

[0078] Furthermore, it also includes a model training step, which is divided into two stages:

[0079] The first stage trains an augmentation network based on pairs of underwater images to be augmented and reference images, with constraints including image restoration fidelity loss, pseudo-physical degradation consistency loss, and frequency consistency loss.

[0080] The second stage uses a semantic prior network with fixed parameters to provide task consistency supervision, performs task-aware fine-tuning on the augmentation network, and periodically replays pairs of preset quality anchor samples during training, applying quality anchor replay loss.

[0081] The overall training objective of the augmented network is calculated using the following formula:

[0082] Ltotal=λr·Lres+λp·Lphys+λf·Lfreq+λt·Ltask+λi·Liqa+λq·Lqa

[0083] Where Ltotal is the total loss, Lres is the image restoration fidelity loss, Lphys is the pseudo-physical degradation consistency loss, Lfreq is the frequency consistency loss, Ltask is the task consistency loss, Liqa is the lightweight image quality regularization term, Lqa is the quality anchor playback loss, and λr, λp, λf, λt, λi, and λq are the non-negative weight coefficients of the corresponding loss terms.

[0084] The present invention also provides an electronic device, including a memory, a processor, and computer program instructions stored in the memory and executable by the processor, wherein when the processor executes the computer program instructions, it can implement the steps of the method described above.

[0085] The present invention also provides a computer-readable storage medium having stored thereon computer program instructions that can be executed by a processor, wherein when the processor executes the computer program instructions, it can implement the steps of the method described above.

[0086] Compared with the prior art, the present invention has the following beneficial effects:

[0087] 1. By using a semantic prior network with fixed parameters, dense semantic responses are converted into foreground soft gating, boundary soft gating, and background soft gating, enabling the augmentation network to obtain stable semantic region coordinates. Continuous soft gating is used to process blurred target boundaries and turbid transition regions, avoiding the augmentation network's reliance on precise semantic category labels, and achieving region-sensitive augmentation for foreground targets, boundary structures, and water background.

[0088] 2. The degradation features are scaled and biased by intermediate semantic features, and attenuation, transmission, illumination, structural degradation and background light are constructed by independent bounded prediction heads. Without requiring calibration depth, absorption coefficient and scattering coefficient, the high-level semantic region division is connected with the low-level underwater degradation conditions, so that regions with similar local color statistics but different semantic attributes can obtain different recovery conditions.

[0089] 3. By correcting low-frequency color and illumination degradation and restoring high-frequency edge and texture structures through color restoration branch and semantically perceptive wavelet restoration branch respectively, and by using soft gating of foreground, boundary and background to limit the restoration intensity of each region, it is possible to reduce the over-color correction of the target surface and the false enhancement of noisy high-frequency information in smooth water background.

[0090] 4. By simultaneously receiving semantic region soft gating and degradation condition pixel-wise fusion gating, color restoration candidate images and wavelet restoration candidate images are adaptively selected according to local semantic regions and degradation states, so that the enhancement results have both stable color and illumination restoration and structure preservation capabilities for downstream perception tasks.

[0091] 5. By periodically applying paired image restoration constraints during task perception fine-tuning through group supervision and quality anchor replay, the visual quality drift caused by semantic supervision can be reduced, enabling the augmentation network to maintain a balance between image restoration fidelity, underwater image quality, and downstream perception availability. Attached Figure Description

[0092] Appendix Figure 1 This is a schematic diagram of the overall framework of the present invention, including semantic region partitioning, pseudo-physical degradation condition construction, bi-branch recovery, and adaptive fusion.

[0093] Appendix Figure 2 This is a schematic diagram of the region-guided color recovery branch of the present invention;

[0094] Appendix Figure 3 This is a schematic diagram of the semantic-aware wavelet recovery branch of the present invention;

[0095] Appendix Figure 4 This is a schematic diagram of the degradation consistency adaptive fusion gate of the present invention;

[0096] Appendix Figure 5 This is a schematic diagram illustrating the visual enhancement comparison of the present invention on the UIEB and SUIM-E datasets;

[0097] Appendix Figure 6 This is a schematic diagram illustrating the local visual enhancement contrast of the present invention on the UIEB dataset;

[0098] Appendix Figure 7This is a schematic diagram illustrating the local visual enhancement contrast of the present invention on the LSUI dataset;

[0099] Appendix Figure 8 This is a schematic diagram illustrating the local enhancement and comparison of real underwater images on the RUIE-UCCS dataset according to the present invention;

[0100] Appendix Figure 9 This is a schematic diagram illustrating the semantic segmentation qualitative results of the enhanced images in this invention on the TIUIED dataset;

[0101] Appendix Figure 10 This is a schematic diagram illustrating the qualitative results of target detection in the enhanced image on the Brackish dataset according to the present invention;

[0102] Appendix Figure 11 This is a visualization diagram of the pseudo-physical degradation conditions of the present invention on controlled synthetic data and the UIEB dataset;

[0103] Appendix Figure 12 This is a schematic diagram of the full-reference quantitative comparison results of the present invention on the UIEB, SUIM-E, and LSUI datasets;

[0104] Appendix Figure 13 This is a schematic diagram of the reference-free quantitative comparison results of the present invention on the RUIE-UCCS and RUIE-UIQS datasets;

[0105] Appendix Figure 14 This is a schematic diagram showing the quantitative comparison results of model complexity and inference efficiency in this invention;

[0106] Appendix Figure 15 This is a schematic diagram illustrating the quantitative comparison results of semantic segmentation of the enhanced images in this invention on the TIUIED dataset;

[0107] Appendix Figure 16 This is a schematic diagram illustrating the quantitative comparison results of target detection in the enhanced images of this invention on the Brackish dataset;

[0108] Appendix Figure 17 This is a schematic diagram of the quantitative results of the ablation experiment of the constituent modules of the present invention;

[0109] Appendix Figure 18 This is a schematic diagram of the quantitative results of the ablation experiment under the pseudo-physical degradation conditions of the present invention. Detailed Implementation

[0110] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.

[0111] As attached Figure 1 To be continued Figure 4As shown, this invention provides an underwater image enhancement method based on semantic guidance and degradation consistency. The method uses a semantic prior network with fixed parameters to extract dense semantic responses and intermediate semantic features. The responses and features are then converted into soft gating foreground, boundary, and background features for restoration. Degradation features are modulated using semantic features, and various bounded pseudo-physical degradation conditions are constructed. Low-frequency color illumination degradation and high-frequency structure restoration are corrected through region-guided color restoration branches and semantically perceptive wavelet restoration branches, respectively. Then, the two candidate results are fused pixel by pixel based on the local semantic region and degradation state. During the training process, group supervision and quality anchor playback are further adopted to maintain the image restoration quality and the semantic structure required for downstream perception.

[0112] The method is used to enhance a single underwater image to be enhanced. By spatially corresponding semantic region gating, pseudo-physical degradation conditions, recovery response, and fusion weights, it improves color shift, scattering fog, illumination imbalance, and structural blur while preserving the target appearance, boundaries, and task-related textures. The method includes the following steps:

[0113] Step S1: Obtain the underwater image to be enhanced, extract dense semantic response and intermediate semantic features using a semantic prior network with fixed parameters, and fuse the intermediate semantic features with the image gradient of the underwater image to be enhanced to generate foreground soft gating, boundary soft gating and background soft gating.

[0114] Step S2: Encode the degradation features of the underwater image to be enhanced and its image gradient. Use the intermediate semantic features to scale and bias modulate the degradation features. Based on the modulated degradation features, predict the attenuation characterization, transmission characterization, illumination characterization, structural degradation characterization and background light characterization respectively to form the pseudo-physical degradation conditions of semantic modulation.

[0115] Step S3: Use a degradation consistency dual-branch recovery network to restore the underwater image to be enhanced. The color recovery branch uses degradation conditions related to color and illumination, as well as foreground soft gating and background soft gating to generate color recovery candidate images. The wavelet recovery branch uses different degradation conditions and semantic region soft gating to recover low-frequency color illumination information and high-frequency structure information respectively, and generates wavelet recovery candidate images.

[0116] Step S4: Generate a pixel-wise fusion gate based on the underwater image to be enhanced, the color restoration candidate image, the wavelet restoration candidate image, the degradation condition, the image gradient, and the soft gate of each semantic region, and use the pixel-wise fusion gate to perform weighted fusion on the two candidate images to obtain the enhanced underwater image;

[0117] Step S5: The augmentation network is trained in two stages using a group loss function. In the first stage, image restoration training is performed based on pairs of underwater degraded images and reference images. In the second stage, task consistency supervision is used for task-aware fine-tuning, and pairs of quality anchor samples are periodically replayed to constrain image quality drift during the task-aware fine-tuning process.

[0118] In step S1, let the underwater image to be enhanced be I, I∈R H×W×3 When paired supervision exists, the reference image is J, and the enhanced image is... Enhanced Network E θ Given the underwater image to be enhanced and the dense semantic prior Ssem, the underwater image enhancement process is expressed by the following formula:

[0119] =E θ (I;Ssem)

[0120] Where θ represents the network parameters of the augmented network.

[0121] As attached Figure 1 As shown, the overall forward processing of the method is expressed by the following formula:

[0122] (Ps, Fs)=Tφ(I), Gs=G(Fs,▽I), P=D(I,▽I, Fs, Gs)

[0123] Jc=C(I,P,Gs), Jw=W(I,P,Gs), =F(I, Jc, Jw, P, Gs)

[0124] Where Tφ represents a semantic prior extractor with fixed parameters; Ps and Fs represent dense semantic response and intermediate semantic features, respectively; Gs represents the set of soft-gated semantic regions; P represents the pseudo-physical degradation condition; Jc and Jw represent color restoration candidate images and wavelet restoration candidate images, respectively; C() represents the color restoration branch; W() represents the wavelet restoration branch; and F() represents the degradation consistency fusion module.

[0125] The semantic prior network in step S1 includes a DINOv3 backbone network with fixed parameters and a lightweight dense decoder. The lightweight dense decoder is adapted based on underwater semantic annotations before the augmentation network is trained, and the DINOv3 backbone network maintains fixed parameters. During the augmentation network training process, the semantic prior network acts as a fixed semantic condition provider and semantic consistency evaluator, and the recovery loss of the augmentation network does not backpropagate gradients to the semantic prior network.

[0126] The semantic prior extraction process is expressed by the following formula:

[0127] (Ps, Fs) = Tφ(I)

[0128] Furthermore, the processing procedure of the semantic prior network is expressed by the following formula:

[0129] Zs=Bφ(I), (Ps, Fs)=Up(Hs(Zs));

[0130] Where Bφ() represents the DINOv3 backbone network with fixed parameters; Zs represents the block-level basic features extracted by the backbone network; Hs() represents the lightweight dense decoder; Up() represents scaling the dense response to the spatial resolution of the underwater image to be enhanced; Ps∈R H×W×K Represents the dense semantic responses corresponding to K semantic categories; Fs∈R cs×H×W This represents the compact intermediate semantic features output before the final classifier of the lightweight dense decoder.

[0131] Category-level semantic responses cannot directly indicate where color correction, boundary enhancement, and background scattering suppression should be applied. Therefore, after scaling intermediate semantic features to the spatial resolution of the underwater image to be enhanced, they are concatenated with the image gradient, and three continuous-value soft gates are generated through lightweight convolutional mapping and the Sigmoid activation function. The process is expressed by the following formula:

[0132] Gs={Gf, Gb, Gbg}=σ(M([Fs,▽I]))

[0133] Wherein, Gf, Gb, and Gbg represent foreground soft gating, boundary soft gating, and background soft gating, respectively; M represents lightweight convolutional mapping; σ represents the sigmoid activation function; [·] represents feature connectivity; and ▽I represents the image gradient of the underwater image to be enhanced. The foreground soft gating is used to identify target areas that need to maintain their appearance, the boundary soft gating is used to identify target contours and texture transition areas that are easily affected by underwater scattering, and the background soft gating is used to identify water background areas dominated by color shifts, occlusion light, and non-uniform illumination. All three gatings are continuous soft gatings to accommodate blurred target boundaries and turbid transition areas.

[0134] In step S2, the imaging relationship of the underwater images is expressed by the following formula:

[0135] Ic(x) = Jc(x)·tc(x) + B∞ c (1-tc(x)), c∈{r,g,b}

[0136] Where Ic(x) represents the degraded image value of color channel c at pixel position x; Jc(x) represents the corresponding sharp scene value; tc(x) represents the transmittance; B∞ c Indicates background light.

[0137] Because it is difficult to accurately estimate physical parameters from a single underwater image under non-uniform lighting and mixed water conditions, this invention does not directly predict calibrated underwater optical parameters. Instead, it constructs a set of bounded and learnable pseudo-physical degradation conditions inspired by physical imaging factors. These pseudo-physical degradation conditions are expressed by the following formula:

[0138] P={β,t,L,S,B∞,▽I}

[0139] Wherein, β represents the attenuation form of color degradation; t represents the transmission form of visibility; L represents the illumination distribution; S represents the structural degradation; B∞ represents the background light; and ▽I represents the deterministic edge cue. The values ​​of β, t, L, S, and B∞ are dimensionless soft conditions and are not used as calibrated depth, absorption coefficient, scattering coefficient, or intrinsic optical parameters.

[0140] In step S2, the underwater image to be enhanced and the image gradient are first encoded to extract low-level degradation features. The process is expressed by the following formula:

[0141] Fd=Hd([I,▽I])

[0142] Where Hd represents the degenerate feature encoder; Fd represents the low-level degenerate feature.

[0143] Since the degradation features differ across semantic regions, multiplicative scaling and additive bias modulation are applied to the low-level degradation features using intermediate semantic features. This process is expressed by the following formula:

[0144] =Fd⊙(1+ρtanh(Γ(Fs)))+ρtanh(Δ(Fs))

[0145] Where Γ and Δ represent the semantic scale term prediction mapping and the semantic bias term prediction mapping, respectively; ρ represents the preset or learnable semantic modulation intensity; and ⊙ represents element-wise multiplication. Multiplicative scale modulation is used to change the response intensity of degraded features, and additive bias modulation is used to change the distribution of degraded features according to the semantic context, so that foreground targets and water backgrounds with similar local color statistics can correspond to different degradation states.

[0146] Based on the modulated degradation features, pseudo-physical degradation conditions are generated using mutually independent bounded prediction heads. The process is expressed by the following formula:

[0147] {β, t, L, S, B∞} = Hp( )

[0148] Furthermore, the prediction process for each pseudo-physical degradation condition is expressed by the following formula:

[0149] β=σ(Hβ( )), t=σ(Ht( )), L=σ(HL( ))

[0150] S=σ(HS( )), B∞=σ(HB(GAP( )))

[0151] Where Hβ, Ht, HL, HS, and HB represent independent prediction heads for attenuation, transmission, illumination, structural degradation, and background light characteristics, respectively; GAP represents global average pooling. β∈[0,1] H×W×3 t, L, S ∈ [0, 1] H×W×1 B∞∈[0,1] 1×1×3 The background light characterization represents the spatial resolution broadcast to the underwater image to be enhanced during use. Independent prediction heads are used to represent color attenuation, visibility, illumination, and structural degradation with different spatial distribution characteristics, respectively, while a shared degradation feature encoder is used to reduce redundant computation.

[0152] β, t, L, and B∞ are used to guide low-frequency color and illumination restoration, S, Gf, and Gb are used to guide structure-sensitive restoration, and the image gradient ▽I is used for wavelet thinning and degradation consistency fusion. During training, t and B∞ directly participate in imaging consistency constraints, t and L participate in edge-aware smoothing constraints, and β and S are learned through image restoration, frequency consistency, and task consistency objectives.

[0153] The degradation consistency dual-branch recovery network in step S3 includes a color recovery branch and a semantically aware wavelet recovery branch. The color recovery branch is used to correct low-frequency color shifts and illumination imbalances, while the semantically aware wavelet recovery branch is used to recover high-frequency edges and texture structures.

[0154] As attached Figure 2 As shown, the color restoration branch first connects the underwater image to be enhanced, the attenuation characterization, the transmission characterization, the illumination characterization, and the background light characterization to form a color conditional tensor. This process is expressed by the following formula:

[0155] Xc = [I, β, t, L, B∞]

[0156] The color condition tensor is mapped to bounded three-channel color residuals through compact convolution residual mapping. The process is expressed by the following formula:

[0157] Fc 0 =δ(Conv3×3(Xc)); Fc m =Fc m-1 +Bc m (Fc m-1), m=1,…,Mc; Δc=tanh(Conv1×1(CA(Fc Mc )))

[0158] Where δ represents a nonlinear activation function; Bc m represents the m-th residual convolutional block; Mc represents the number of residual convolutional blocks; CA represents channel attention; Conv3×3 and Conv1×1 represent 3×3 convolution and 1×1 convolution, respectively; Δc represents the bounded three-channel color residual.

[0159] For simplicity, the color residual prediction process is expressed as follows:

[0160] Δc=Rc([I, β, t, L, B∞])

[0161] Where Rc represents the color residual prediction mapping.

[0162] To suppress background color shift in water bodies while avoiding overcorrection of target texture, the gain of the color recovery region is predicted based on background soft gating and foreground soft gating. This process is expressed by the following formula:

[0163] Ac = Ac(Gbg, Gf)

[0164] The candidate images for color restoration are expressed by the following formula:

[0165] Jc=clip(I+ηc·Ac⊙Δc,0,1)

[0166] Where Ac represents the color restoration region gain; ηc represents the preset or learnable color residual intensity; and clip represents limiting the output value within a preset image value range. The color restoration branch uses a residual form to correct the original underwater image to be enhanced, so that the water background area receives relatively strong color compensation, the foreground target surface receives relatively weak color compensation, and the risk of producing unnatural colors is reduced.

[0167] As attached Figure 3 As shown, the semantically aware wavelet recovery branch first performs wavelet decomposition on the underwater image to be enhanced, obtaining one low-frequency sub-band and three high-frequency sub-bands. The process is expressed by the following formula:

[0168] (ILL, ILH, IHL, IHH) = Dw(I)

[0169] Where Dw represents wavelet decomposition; ILL represents the low-frequency subband containing coarse-grained color and lighting information; ILH, IHL, and IHH represent the high-frequency subbands containing edge and texture responses in different directions, respectively; IHF=[ILH, IHL, IHH] represents the concatenated high-frequency subband. Degradation conditions and semantic region soft gating are used to guide the resampling of each subband according to its spatial dimensions.

[0170] For the low-frequency sub-band, a low-frequency recovery gate is generated based on background soft gating and transmission characterization, and the low-frequency residual is predicted using transmission characterization, illumination characterization, and background soft gating. The process is expressed by the following formula:

[0171] ALL = ALL(Gbg, t); =ILL+ηLL·ALL⊙RLL([ILL,t,L,Gbg])

[0172] Wherein, ALL represents low-frequency recovery gating; RLL represents low-frequency residual mapping; and ηLL represents preset or learnable low-frequency residual intensity. The low-frequency recovery gating is used to perform coarse-grained scattering and illumination correction in water background and low-visibility areas.

[0173] For high-frequency subbands, high-frequency recovery gates are generated based on boundary soft gates and foreground soft gates, and high-frequency residuals are predicted using foreground soft gates, boundary soft gates, and structural degradation characterization. This process is expressed by the following formula:

[0174] AHF = AHF(Gb, Gf); =IHF+ηHF·AHF⊙RHF([IHF,Gf,Gb,S])

[0175] Wherein, AHF represents high-frequency recovery gating; RHF represents high-frequency residual mapping; and ηHF represents a preset or learnable high-frequency residual intensity. The high-frequency recovery gating is used to enhance target boundaries and structurally meaningful textures, while suppressing noisy high-frequency information in smooth water backgrounds. The low-frequency residual mapping RLL and the high-frequency residual mapping RHF use independent parameters, and both the low-frequency and high-frequency recovery gating employ a sigmoid output to keep the recovery intensity bounded at each location.

[0176] Perform inverse wavelet transform on the recovered low-frequency and high-frequency subbands to obtain the initial wavelet-reconstructed image. The process is expressed by the following formula:

[0177] Jw 0 = Dw -1 ( , , , )

[0178] Among them, Dw-1 This represents the inverse wavelet transform. In one embodiment, the wavelet decomposition and inverse wavelet transform employ the Haar wavelet transform.

[0179] To suppress artifacts generated during subband restoration and reconstruction, spatial refinement gating is predicted based on the initial wavelet-restored image, structural degradation characterization, image gradient, foreground soft gating, and boundary soft gating. This process is expressed by the following formula:

[0180] Aw=Aw([Jw 0 ,S,▽I,Gf,Gb])

[0181] The wavelet-reconstructed candidate image is expressed by the following formula:

[0182] Jw=clip(Jw 0 +ηw·Aw⊙Rs([I,Jw 0 ,Aw]), 0,1)

[0183] Where Aw represents spatial refinement gating; Rs represents spatial residual refinement mapping; and ηw represents preset or learnable spatial residual refinement intensity. Through this spatial residual refinement, wavelet subband reconstruction artifacts are compensated for, resulting in a restored candidate image Jw that preserves the target structure.

[0184] As attached Figure 4 As shown, in step S4, the color restoration candidate image is used to provide stable overall color and illumination correction, and the wavelet restoration candidate image is used to provide edge and texture structures sensitive to downstream perception tasks. To avoid directly averaging the two restoration candidate images and ignoring the restoration requirements of spatial variations, the underwater image to be enhanced, the two restoration candidate images, the transmission representation, the structural degradation representation, the image gradient, and the three semantic regions are soft-gated and connected to form a fusion conditional tensor. The process is expressed by the following formula:

[0185] Xf=[I, Jc, Jw, t, S, ▽I, Gf, Gb, Gbg]

[0186] The fusion condition tensor is used to generate a pixel-wise fusion gate through shallow spatial mapping, residual blocks, 1×1 convolution, and a sigmoid activation function. The process is expressed by the following formula:

[0187] α=σ(Conv1×1 (Φf(Xf)))

[0188] Where Φf represents a shallow spatial mapping consisting of convolutional blocks and residual blocks; α∈[0,1] H×W This represents the fusion weights at each pixel position in the wavelet recovery candidate image.

[0189] The enhanced underwater image is expressed by the following formula:

[0190] =α⊙Jw+(1-α)⊙Jc

[0191] Because the pixel-by-pixel fusion gate simultaneously receives semantic region soft gating and degradation conditions, the fusion module can increase the fusion weight of wavelet restoration candidate images in target boundaries and texture-rich foreground regions, and increase the fusion weight of color restoration candidate images in smooth water background regions.

[0192] In step S5, the overall training objective of the augmented network is divided into image restoration fidelity, pseudo-physical degradation consistency, frequency consistency, task consistency, lightweight image quality regularization, and quality anchor playback according to the function of different supervision signals. The overall training objective is expressed by the formula:

[0193] Ltotal=λr·Lres+λp·Lphys+λf·Lfreq+λt·Ltask+λi·Liqa+λq·Lqa

[0194] Where Lres represents the image restoration fidelity loss; Lphys represents the pseudo-physical degradation consistency loss; Lfreq represents the frequency consistency loss; Ltask represents the task consistency loss; Liqa represents the lightweight image quality regularization term; Lqa represents the quality anchor playback loss; and λr, λp, λf, λt, λi, and λq represent the non-negative weight coefficients of the corresponding loss terms.

[0195] Step S5, during the training phase, also includes the following steps:

[0196] Step A1: In the first training phase, the augmentation network is trained using pairs of underwater images to be augmented and reference images. The augmentation network is constrained by image restoration fidelity loss, pseudo-physical degradation consistency loss and frequency consistency loss, resulting in enhanced images, degradation conditions and frequency restoration results.

[0197] Step A2: In the second training phase, a semantic prior network with fixed parameters is used to provide task consistency supervision, and the augmentation network is fine-tuned for task awareness. Paired quality anchor samples are periodically replayed, and the augmentation network maintains the restoration quality based on the reference image by constraining the quality anchor replay loss.

[0198] In step A1, the image restoration fidelity loss is expressed by the formula:

[0199] Lres=L1+λssim·Lssim+λcol·Lcol+λstr·Lstr

[0200] Wherein, λssim, λcol, and λstr represent the weight coefficients of structural similarity loss, color constancy loss, and structural loss, respectively.

[0201] The pixel fidelity loss and structural similarity loss are expressed by the following formulas:

[0202] L1=‖ -J‖1,Lssim=1-SSIM( J)

[0203] Here, SSIM represents calculating the structural similarity between the enhanced image and the reference image.

[0204] The color constancy loss is used to constrain the mean imbalance between different color channels in the enhanced image. The color constancy loss is expressed by the formula:

[0205] Lcol=Σ (p,q)∈Ω (μp( )-μq( )) 2 ,Ω={(r,g),(r,b),(g,b)}

[0206] Where μp and μq represent the mean values ​​of the corresponding color channels in the enhanced image, respectively.

[0207] The structural loss is used to maintain gradient consistency between the enhanced image and the reference image, and the structural loss is expressed by the formula:

[0208] Lstr=‖▽ -▽J‖1

[0209] The pseudo-physical degradation consistency loss includes imaging consistency loss and edge-aware smoothing loss, expressed by the following formula:

[0210] Lphys = Lphy + λsm·Lsm

[0211] Where Lphy represents the imaging consistency loss; Lsm represents the edge-aware smoothing loss; and λsm represents the weighting coefficient of the edge-aware smoothing loss.

[0212] The imaging consistency loss reconstructs the underwater image to be enhanced using the enhanced image, transmission characterization, and background light characterization, expressed by the following formula:

[0213] Lphy=‖I-( ⊙t+B∞(1-t))‖1

[0214] The edge-aware smoothing loss is used to suppress noise variations in transmission and illumination representations in smooth regions, while allowing discontinuous changes in these representations at image edge locations, as expressed by the formula:

[0215] Lsm=Σ p∈{t,L} (|▽xp|e -10|▽xIg| +|▽yp|e -10|▽yIg|)

[0216] Where Ig represents the grayscale image of the underwater image to be enhanced; ▽x and ▽y represent the gradient operations in the horizontal and vertical directions, respectively.

[0217] The frequency consistency loss is achieved using wavelet subband recovery loss, expressed by the formula:

[0218] Lfreq=Lwav

[0219] The wavelet subband recovery loss is expressed by the following formula:

[0220] Lwav=ωll·‖ LL-JLL‖1+(ωhf / 3)Σ k∈{LH,HL,HH} || k-Jk‖1+ωe·Ledge

[0221] in, k and Jk represent the Haar wavelet subbands corresponding to the enhanced image and the reference image, respectively; ωll, ωhf and ωe represent the weights of the low-frequency subband loss, high-frequency subband loss and edge constraint term, respectively; Ledge represents the edge hinge term, which is used to suppress the high-frequency energy of the enhanced image from being lower than the preset margin of the reference image, and to avoid replacing meaningful structural recovery by simply increasing local contrast.

[0222] In step A2, a semantic prior network with fixed parameters is used to compare the intermediate semantic responses of the enhanced image and the reference image. The task consistency loss is expressed by the formula:

[0223]

[0224] Where Ψ represents the intermediate semantic feature extraction mapping of the semantic prior network; Ys represents semantic annotation; This indicates that cross-entropy loss is applied only when the training samples have semantic annotations; CE represents cross-entropy loss. Since the semantic prior network keeps its parameters fixed, the gradient of the task consistency loss is only propagated to the augmentation network, and the augmentation network itself does not output a semantic segmentation mask.

[0225] The lightweight image quality regularization term Liqa consists of differentiable surrogate terms related to the color richness, contrast, exposure, saturation, and gradient energy of underwater images, and participates in training as a weak regularization term to avoid the enhancement network compromising the fidelity of paired image restoration in order to improve the quality evaluation results of no-reference images.

[0226] During the task-aware fine-tuning process, pairs of quality anchor samples are periodically input into the enhancement network, and a quality anchor replay loss is applied to them. The quality anchor replay loss is expressed by the following formula:

[0227] Lqa=Lres( q, Jq)+λqt·Ltask( q, Jq)+λqw·Lwav( q,Jq)+λqi·Liqa( q, Jq)

[0228] Where (Iq, Jq) represent the paired quality anchor samples for playback; q represents the augmentation result corresponding to the quality anchor input image Iq; λqt, λqw, and λqi represent the weight coefficients of the task consistency loss, wavelet subband restoration loss, and lightweight image quality regularization term during quality anchor playback, respectively. By periodically replaying reliable paired augmentation samples, semantic supervision is prevented from dominating the image restoration target during task-aware fine-tuning.

[0229] Example

[0230] In this example, by enhancing a single degraded underwater image, the aim is to obtain an enhanced image with natural colors, clear contrast, complete target boundaries, and the ability to serve underwater semantic segmentation and target detection tasks.

[0231] Considering that existing methods typically learn a uniform image-level restoration map, they struggle to simultaneously handle color shifts, scattering fog, and illumination imbalances in the water background, as well as texture attenuation and structural blurring in foreground targets and boundary regions. This paper proposes a semantically guided and degradation-consistency-based underwater image enhancement method, termed SGDC-UIE. This method transforms the parameter-fixed DINOv3 dense semantic response into soft gating of the foreground, boundary, and background for restoration. It then constructs pseudo-physical degradation conditions using these soft gating and semantic features, forming two complementary candidate images through color restoration and wavelet restoration branches. These images are then spatially adaptively fused using a degradation-consistency fusion gate. Through group supervision and quality-anchored playback, it enhances visual quality while preserving task-relevant semantic structure.

[0232] The method described in this example uses UIEB, SUIM-E, and LSUI as paired underwater image enhancement evaluation data, RUIE-UCCS and RUIE-UIQS as real-world, no-reference underwater image evaluation data, TIUIED as semantic segmentation evaluation data, and Brackish as underwater target detection evaluation data. Each dataset is evaluated separately, and test images from different datasets are not merged. When official training and test set partitions are provided for the dataset, the official partitions are used, and the list of test images used for each comparison method is fixed.

[0233] Step 1: Use a semantic prior network with fixed parameters to extract dense semantic responses and intermediate semantic features of the underwater image to be enhanced, and generate foreground soft gating, boundary soft gating and background soft gating.

[0234] Step 2: Modulate the degradation features using the intermediate semantic features to construct attenuation characterization, transmission characterization, illumination characterization, structural degradation characterization, and background light characterization.

[0235] Step 3: Use region-guided color restoration branch and semantic-aware wavelet restoration branch to generate color restoration candidate images and wavelet restoration candidate images respectively;

[0236] Step 4: Generate pixel-by-pixel fusion gates based on semantic region soft gating, pseudo-physical degradation conditions, and two candidate images to obtain enhanced underwater images;

[0237] Step 5 involves two training phases: paired image restoration training and task-aware fine-tuning combined with quality anchor playback, to optimize the augmentation network.

[0238] Furthermore, in this example, images are uniformly adjusted to 384×384 pixels during training. The semantic prior network consists of a DINOv3 backbone network and a lightweight dense decoder, with the DINOv3 backbone network maintaining fixed parameters throughout the lightweight dense decoder adaptation, augmentation network training, and inference processes. The lightweight dense decoder is adapted once using 1525 pixel-annotated images from the TIUIED training set, with 110 test images retained for evaluation; only 0.591M parameters of the lightweight dense decoder are optimized. No semantic labels, water body type labels, or camera metadata are required during inference.

[0239] Furthermore, the augmented network was trained using the AdamW optimizer and mixed precision with a batch size of 4. During the task-aware fine-tuning phase, the learning rate was set to 5 × 10⁻⁶. -6 The weight decay is set to 10. -3 The experiments were conducted on the PyTorch framework and an NVIDIA RTX 4090 graphics processor. To evaluate reproducibility, training was performed using three random seeds (2023, 2024, and 2025) under a full DINOv3 configuration.

[0240] In this specific implementation, the underwater image enhancement method can be implemented in software. To objectively evaluate the enhancement performance of the proposed method, it is evaluated from four aspects: full-reference enhancement quality, no-reference enhancement quality, downstream perception performance, and computational complexity. Full-reference evaluation uses Peak Signal-to-Noise Ratio (PSNR), Structural Similarity Index (SSIM), Perceptual Quality Index (PCQI), and Learned Perceptual Patch Similarity Index (LPIPS); no-reference evaluation uses Underwater Image Quality Metric (UIQM), Natural Image Quality Evaluation (NIQE), BRISQUE, Average Gradient (AG), and Edge Intensity (EI); semantic segmentation uses pixel precision, Average Intersection over Union (IUI), Dice, Foreground Dice, and Region IUI; target detection uses precision, recall, mAP50, mAP75, and mAP50:95.

[0241] As attached Figure 5 and attached Figure 6 As shown, the underwater images from UIEB and SUIM-E exhibit significant blue-green tint, low contrast, and weakened local structure. Some comparative methods can improve overall brightness, but they tend to preserve local color deviations, blur target boundaries, or cause the restored color and edge statistics to deviate from the reference image. The method in this example utilizes background soft gating and a low-frequency recovery path to complete color and illumination correction, while simultaneously using foreground soft gating, boundary soft gating, and a high-frequency recovery path to preserve the target contour, resulting in a more natural color and local contrast in the enhanced image.

[0242] As attached Figure 7 As shown, in the LSUI paired test images, some comparison methods have high single-pixel indices, but fine textures may still be weakened or color imbalanced in magnified local areas. The method in this example, through pixel-by-pixel selection of color restoration candidate images and wavelet restoration candidate images, can preserve local contours without excessively increasing global contrast. For the attached... Figure 8 The RUIE-UCCS and RUIE-UIQS real no-reference images shown demonstrate that the method in this example can mitigate the blue-green tint and low visibility issues, and avoid the amplification of background noise and unnatural edges in smooth water bodies by global enhancement.

[0243] As attached Figure 12As shown, in the full-reference quantitative results, the method in this example achieves a PSNR of 23.519 dB, SSIM of 0.863, PCQI of 0.908, and LPIPS of 0.133 on UIEB; 22.566 dB on SUIM-E, SSIM of 0.866, PCQI of 0.921, and LPIPS of 0.130; and 22.499 dB on LSUI, SSIM of 0.848, PCQI of 0.879, and LPIPS of 0.224. The PSNR on UIEB is 0.031 dB higher than that of PUGAN (23.488 dB), but this small difference is not statistically significant. Combining structural, perceptual, and cross-dataset metrics, the method in this example demonstrates a good overall balance.

[0244] As attached Figure 13 As shown, in the reference-free quantitative results, the proposed method achieves a UIQM of 3.231, a NIQE of 5.233, a BRISQUE of 32.718, an AG of 0.024, and an EI of 0.203 on RUIE-UCCS; and a UIQM of 3.221, a NIQE of 5.296, a BRISQUE of 34.167, an AG of 0.025, and an EI of 0.217 on RUIE-UIQS. These results demonstrate that the proposed method can balance underwater image quality, natural image statistics, and edge details in real-world scenarios without reference images.

[0245] As attached Figure 9 and attached Figure 15 As shown, in the downstream semantic segmentation evaluation, the DINOv3 evaluator was used to evaluate the TIUIED enhanced image. In this example, the method achieved 87.994% pixel accuracy, 73.592% average intersection-over-union (IoU) ratio, 84.043% Dice, 81.263% foreground Dice, and 70.698% region IoU. When using independent U-Net evaluation, the average IoU ratio was 40.786% and the Dice was 52.601%. When using DeepLabv3+ evaluation, the average IoU ratio was 44.573% and the Dice was 58.175%. These results demonstrate that the semantic information preserved in the enhanced image is not only applicable to homologous evaluators but can also serve semantic segmentation networks with different structures.

[0246] As attached Figure 10 and attached Figure 16As shown, in the downstream target detection evaluation, when using YOLOv8n, the method in this example achieved an accuracy of 97.321%, a recall of 95.329%, an mAP50 of 97.764%, an mAP75 of 88.638%, and an mAP50:95 of 77.146%. When using RT-DETR, the accuracy rates were 98.854%, 97.650%, 98.873%, 92.381%, and 82.222%, respectively. When using Faster R-CNN, the accuracy rates were 88.118%, 97.778%, 95.813%, 82.091%, and 70.620%, respectively. These results are from a single experiment using a fixed detector and the same list of test images, demonstrating that degradation consistency restoration can improve the visibility of low-contrast underwater targets and maintains good applicability to different detection structures.

[0247] As attached Figure 14 As shown, in the complexity evaluation, the complete processing flow contains 22.572M parameters, with a computational load of 54.767G floating-point operations. The inference latency for a single 384×384 pixel image is 11.539ms, the processing speed is 86.666 frames per second, and the video memory usage is 237.296MB. The recovery module, excluding semantic prior extraction, contains 0.394M parameters. While the fixed-parameter semantic prior extraction introduces some overhead, the complete flow maintains real-time processing capabilities. Quality anchor replay is only used during the training phase and does not increase inference overhead.

[0248] As attached Figure 11 As shown, the attenuation characterization, transmission characterization, illumination characterization, structural degradation characterization, and background light characterization output by the model present degradation-related foreground-background transitions and boundary structures on controlled synthetic data and UIEB real underwater images; these characterizations are soft conditions for recovery, rather than calibrated physical measurements.

[0249] As attached Figure 17 and attached Figure 18 As shown, in the ablation results, removing the DINOv3 semantic prior, using random or zero semantic responses, removing the entire wavelet recovery branch, removing low-frequency or high-frequency paths, canceling wavelet semantic gating, and removing quality anchor playback all resulted in varying degrees of change in paired recovery quality, no-reference image quality, or semantic segmentation metrics. Furthermore, removing β, t, L, S, or B∞ degradation conditions one by one altered the overall balance between color, structure, and downstream perceptual metrics. This demonstrates that fixed semantic coordinates, pseudo-physical degradation conditions, frequency-selective recovery, pixel-by-pixel fusion, and quality anchor playback collectively constitute a complementary technical solution.

[0250] The present invention also provides an electronic device, including a memory, a processor, and computer program instructions stored in the memory and executable by the processor, wherein when the processor executes the computer program instructions, it can implement the steps of the method described above.

[0251] The present invention also provides a computer-readable storage medium having stored thereon computer program instructions that can be executed by a processor, wherein when the processor executes the computer program instructions, it can implement the steps of the method described above.

[0252] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.

Claims

1. An underwater image enhancement method based on semantic guidance and degradation consistency, characterized in that, include: S1. Obtain the underwater image to be enhanced. Use a semantic prior network with fixed parameters to extract the dense semantic response and intermediate semantic features of the underwater image to be enhanced. After feature concatenation of the intermediate semantic features with the image gradient of the underwater image to be enhanced, the foreground soft gate, boundary soft gate and background soft gate are generated through lightweight convolutional mapping and Sigmoid activation function. S2. Encode the underwater image to be enhanced and its image gradient to obtain low-level degradation features. Use the intermediate semantic features to perform multiplicative scaling and additive bias modulation on the low-level degradation features in sequence. Based on the modulated degradation features, predict the attenuation characterization, transmission characterization, illumination characterization, structural degradation characterization and background light characterization respectively through mutually independent bounded prediction heads to form pseudo-physical degradation conditions. S3. A degradation-consistent dual-branch recovery network is used to recover the underwater image to be enhanced: the color recovery branch connects the underwater image to be enhanced, attenuation characterization, transmission characterization, illumination characterization, and background light characterization to obtain a color conditional tensor, predicts the color residual based on the color conditional tensor, and calculates the color recovery candidate image by combining foreground soft gating and background soft gating; the semantic-aware wavelet recovery branch performs wavelet decomposition on the underwater image to be enhanced to obtain a low-frequency sub-band and multiple high-frequency sub-bands, corrects the low-frequency sub-band based on background soft gating and transmission characterization, and corrects the high-frequency sub-band based on boundary soft gating, foreground soft gating, and structural degradation characterization, and obtains the wavelet recovery candidate image after inverse wavelet transform and spatial residual refinement; S4. The underwater image to be enhanced, the candidate image for color restoration, the candidate image for wavelet restoration, the transmission characterization, the structural degradation characterization, the image gradient, the foreground soft gate, the boundary soft gate, and the background soft gate are connected by feature concatenation to obtain a fusion condition tensor. A pixel-wise fusion gate is generated based on the fusion condition tensor. The candidate image for color restoration and the candidate image for wavelet restoration are weighted and fused according to the pixel-wise fusion gate to obtain the enhanced underwater image.

2. The underwater image enhancement method based on semantic guidance and degradation consistency according to claim 1, characterized in that, In step S1, the semantic prior network includes a DINOv3 backbone network with fixed parameters and a lightweight dense decoder. The lightweight dense decoder is adapted based on underwater semantic annotation data before the augmentation network is trained. During the training process, the parameters of the DINOv3 backbone network remain fixed, and the loss of the augmentation network does not backpropagate gradients to the semantic prior network. The semantic prior extraction process is calculated using the following formula: (Ps, Fs) = Tφ(I) Where I is the underwater image to be enhanced, Tφ is the semantic prior extractor with fixed parameters, and Ps∈R H×W×K Let Fs ∈ R be the dense semantic response corresponding to K semantic categories. cs×H×W The compact intermediate semantic features are the output of the lightweight dense decoder before the final classifier. H and W are the height and width of the underwater image to be enhanced, respectively. K is the total number of semantic categories, and cs is the number of channels of the intermediate semantic features. The overall processing procedure of the semantic prior network is calculated by the following formula: Zs=Bφ(I), (Ps, Fs)=Up(Hs(Zs)) Wherein, Bφ() is the DINOv3 backbone network with fixed parameters, Zs is the block-level basic features extracted by the backbone network, Hs is the lightweight dense decoder, and Up is the upsampling operation that scales the dense response to the spatial resolution of the underwater image to be enhanced.

3. The underwater image enhancement method based on semantic guidance and degradation consistency according to claim 1, characterized in that, In step S2, the multiplicative scaling modulation and additive bias modulation are calculated using the following formulas: =Fd⊙(1+ρtanh(Γ(Fs)))+ρtanh(Δ(Fs)) in, Fd represents the low-level degenerate features, ⊙ represents element-wise multiplication, ρ represents the preset or learnable semantic modulation intensity, Γ represents the semantic scale prediction mapping, Δ represents the semantic bias prediction mapping, Fs represents the intermediate semantic features, and tanh represents the hyperbolic tangent activation function.

4. The underwater image enhancement method based on semantic guidance and degradation consistency according to claim 1, characterized in that, In step S2, the pseudo-physical degradation condition is calculated using the following formula: P={β, t, L, S, B∞, ▽I} Where β is the color degradation characterization in the form of attenuation, t is the visibility characterization in the form of transmission, L is the illumination distribution characterization, S is the structural degradation characterization, B∞ is the background light characterization, and ▽I is the image gradient of the underwater image to be enhanced. The predictions for each pseudo-physical degradation condition are calculated using the following formula: β=σ(Hβ( )) t=σ(Ht( )) L=σ(HL( )) S=σ(HS( )) B∞=σ(HB(GAP( ))) Where σ is the Sigmoid activation function, Hβ, Ht, HL, HS, and HB are independent prediction heads for attenuation characterization, transmission characterization, illumination characterization, structural degradation characterization, and background light characterization, respectively, and GAP is the global average pooling operation. The values ​​and dimensions of each representation satisfy: β∈[0,1] H×W×3 t, L, S ∈ [0, 1] H×W×1 B∞∈[0,1] 1×1×3 The background light characterizes the spatial resolution of the underwater image to be enhanced during use.

5. The underwater image enhancement method based on semantic guidance and degradation consistency according to claim 1, characterized in that, In step S3, the processing procedure for the color restoration branch is calculated using the following formula: Formula for constructing the color condition tensor: Xc = [I, β, t, L, B∞] Where Xc is the color condition tensor, I is the underwater image to be enhanced, [⋅] represents the feature connection operation, β is the color degradation characterization in the form of attenuation, t is the visibility characterization in the form of transmission, L is the illumination distribution characterization, and B∞ is the background light characterization. Formula for predicting color residuals: Δc=Rc([I, β, t, L, B∞]) Where Δc is the bounded three-channel color residual, and Rc is the color residual prediction mapping; Formula for calculating color restoration region gain: Ac = Ac(Gbg, Gf) Where Ac is the color recovery region gain, Gbg is the background soft gating, and Gf is the foreground soft gating; Formula for generating candidate images for color restoration: Jc=clip(I+ηc·Ac⊙Δc, 0, 1) Where Jc is the candidate image for color restoration, ηc is the preset or learnable color residual intensity, and clip is the clipping operation that restricts the output value to the range of [0,1].

6. The underwater image enhancement method based on semantic guidance and degradation consistency according to claim 1, characterized in that, In step S3, the processing procedure of the semantically aware wavelet recovery branch is calculated using the following formula: Wavelet decomposition formula: (ILL, ILH, IHL, IHH) = Dw(I) Where I represents the underwater image to be enhanced, Dw represents the wavelet decomposition operation, ILL represents the low-frequency subband containing coarse-grained color and illumination information, and ILH, IHL, and IHH represent the high-frequency subbands containing edge and texture responses in different directions. The high-frequency subbands are spliced ​​together to form IHF=[ILH,IHL,IHH]. Low-frequency subband correction formula: ALL = ALL(Gbg, t) =ILL+ηLL·ALL⊙RLL([ILL,t,L,Gbg]) Where ALL represents low-frequency recovery gating, ηLL represents preset or learnable low-frequency residual intensity, RLL represents low-frequency residual mapping, t represents visibility characterization in transmission form, and L represents illumination distribution characterization. This is the corrected low-frequency sub-band; High-frequency subband correction formula: AHF = AHF(Gb, Gf) =IHF+ηHF·AHF⊙RHF([IHF,Gf,Gb,S]) Where AHF is high-frequency recovery gating, Gb is boundary soft gating, ηHF is preset or learnable high-frequency residual intensity, and RHF is high-frequency residual mapping. The high-frequency subband is the corrected value, and S represents the structural degradation characterization. Inverse wavelet transform formula: Jw 0 =Dw -1 ( , , , ) Among them, Jw 0 For the initial wavelet reconstruction image, Dw -1 This is an inverse wavelet transform operation. , , These are the corrected high-frequency subbands containing edge and texture responses in different directions; Spatial refinement gating calculation formula: Aw=Aw([Jw 0 , S, ▽I, Gf, Gb]) Among them, Aw is the spatial refinement gating; The formula for generating candidate images using wavelet recovery is as follows: Jw=clip(Jw 0 +ηw·Aw⊙Rs([I,Jw 0 ,Aw]),0,1) Where Jw is the wavelet-restored candidate image, ηw is the preset or learnable spatial residual thinning intensity, Rs is the spatial residual thinning map, and clip is the clipping operation that restricts the output value to the range [0,1].

7. The underwater image enhancement method based on semantic guidance and degradation consistency according to claim 1, characterized in that, In step S4, the fusion process is calculated using the following formula: Formula for constructing the fusion conditional tensor: Xf=[I,Jc,Jw,t,S,▽I,Gf,Gb,Gbg] Where Xf is the fusion condition tensor, I is the underwater image to be enhanced, Jc is the color restoration candidate image, Jw is the wavelet restoration candidate image, t is the visibility representation in the form of transmission, S is the structural degradation representation, ▽I is the image gradient of the underwater image to be enhanced, Gf is the foreground soft gate, Gb is the boundary soft gate, and Gbg is the background soft gate. The formula for calculating pixel-by-pixel fusion gate: α=σ(Conv1×1 (Φf(Xf))) Where α∈[0,1] H×W The wavelet recovery candidate image is fused at each pixel position. Conv1×1 is a 1×1 convolution operation, and Φf is a shallow spatial mapping composed of convolution blocks and residual blocks. Formula for generating enhanced underwater images: =α⊙Jw+(1-α)⊙Jc in, To enhance underwater images.

8. The underwater image enhancement method based on semantic guidance and degradation consistency according to claim 1, characterized in that, It also includes a model training step, which is divided into two stages: The first stage trains an augmentation network based on pairs of underwater images to be augmented and reference images, with constraints including image restoration fidelity loss, pseudo-physical degradation consistency loss, and frequency consistency loss. The second stage uses a semantic prior network with fixed parameters to provide task consistency supervision, performs task-aware fine-tuning on the augmentation network, and periodically replays pairs of preset quality anchor samples during training, applying quality anchor replay loss. The overall training objective of the augmented network is calculated using the following formula: Ltotal=λr·Lres+λp·Lphys+λf·Lfreq+λt·Ltask+λi·Liqa+λq·Lqa Where Ltotal is the total loss, Lres is the image restoration fidelity loss, Lphys is the pseudo-physical degradation consistency loss, Lfreq is the frequency consistency loss, Ltask is the task consistency loss, Liqa is the lightweight image quality regularization term, Lqa is the quality anchor playback loss, and λr, λp, λf, λt, λi, and λq are the non-negative weight coefficients of the corresponding loss terms.

9. An electronic device, characterized in that, It includes a memory, a processor, and computer program instructions stored in the memory and executable by the processor, which, when executed by the processor, enable the implementation of the steps of the method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, It stores computer program instructions that can be executed by a processor, and when the processor executes the computer program instructions, it can implement the steps of the method as described in any one of claims 1-8.