Underwater image enhancement method based on lightweight global context modeling and partition element optimization

By using global context modeling and partition meta-optimization of the LGM-Net model, the problems of local detail restoration and global consistency in underwater image enhancement methods under lightweight inference are solved, achieving efficient underwater image enhancement applicable to underwater robots and marine monitoring equipment.

CN122115251BActive Publication Date: 2026-07-03CHENGDU TECH UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU TECH UNIV
Filing Date
2026-04-28
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing underwater image enhancement methods, while maintaining lightweight inference efficiency, struggle to balance local detail restoration with global color or structural consistency, and lack adaptability to unknown degradation distributions, especially in terms of generalization ability under cross-scene distribution shifts.

Method used

An underwater image enhancement method based on lightweight global context modeling and partitioned meta-optimization is adopted. The method is deployed on the edge using the LGM-Net model. It utilizes the locally reproducible parameter multi-branch representation W-RepMBB and the bottleneck global consistency modeling module PF-BEAM, combined with partitioned second-order optimization P2MO, to achieve adaptive capability and stability for multiple types of degradation distributions.

Benefits of technology

It improves the enhancement quality of underwater images, enhances color naturalness and contrast, reduces computational overhead, is suitable for edge and real-time applications, and enhances cross-domain robustness and rapid adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115251B_ABST
    Figure CN122115251B_ABST
Patent Text Reader

Abstract

This invention discloses an underwater image enhancement method based on lightweight global context modeling and partition meta-optimization, belonging to the field of underwater image enhancement technology. The method includes: reading pre-trained enhancement network parameters θ and loading them into an LGM-Net model; when used for edge-side or real-time inference, performing structural reparameterization on the locally reproducible multi-branch representation. The underwater RGB image to be enhanced is acquired and preprocessed to obtain an input tensor. Initial features are obtained through shallow feature extraction, followed by step-by-step encoding, downsampling, and feature transformation to form multi-scale pyramid features. Projective free sparse expert global modeling is performed at the deepest bottleneck, followed by step-by-step decoding and reconstruction. The final reconstructed features are obtained by skip-connection fusion with the corresponding scale feature channels of the encoder, mapped back to the RGB space by the output reconstruction head, and normalized. The enhanced image is then output to a display or storage device. This application effectively alleviates structural artifacts and local over-enhancement problems, while also enhancing cross-domain robustness and deployment efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of underwater image enhancement technology, specifically to an underwater image enhancement method based on lightweight global context modeling and partition meta-optimization. Background Technology

[0002] Underwater optical imaging often suffers from degradation problems such as color shift, decreased contrast, and blurred details due to the combined effects of light absorption and scattering. At the same time, different water areas and imaging conditions can introduce significant cross-scene distribution shifts, making it difficult for enhancement algorithms to generalize stably in real-world applications.

[0003] Existing underwater image enhancement typically includes:

[0004] 1) Model-independent methods based on pixel statistics, although simple to implement, lack stable constraints and are prone to defects such as over- / under-enhancement, color drift and artifacts;

[0005] 2) Parameter estimation method based on physical imaging model. This method is interpretable, but it is highly sensitive to the estimation of key parameters. Under complex water bodies and non-uniform lighting conditions, it may cause insufficient robustness.

[0006] 3) Deep learning data-driven methods, although they can learn end-to-end mappings, generally suffer from problems such as insufficient cross-domain generalization ability, high overhead for global consistency modeling, and limited efficiency of edge deployment.

[0007] Therefore, there is an urgent need for an underwater image enhancement method that can maintain lightweight inference efficiency while taking into account local detail restoration and global color or structural consistency, and has a stronger ability to adapt to unknown degradation distributions. Summary of the Invention

[0008] The purpose of this invention is to overcome the shortcomings of the prior art and provide an underwater image enhancement method based on lightweight global context modeling and partition meta-optimization.

[0009] The objective of this invention is achieved through the following technical solution:

[0010] This application discloses an underwater image enhancement method based on lightweight global context modeling and partition meta-optimization, including the following steps:

[0011] S1. Read the pre-trained augmented network parameters θ from the memory and then load them into the LGM-Net model. The augmented network parameters θ include the W-RepMBB parameters of the local reproducible multi-branch representation of the shallow, encoding, and decoding paths, the shared sparse expert pool parameters and gating parameters of the bottleneck global consistency modeling module, and the output reconstruction head parameters.

[0012] S2. When the LGM-Net model is used for edge or real-time inference deployment, structural reparameterization is performed on the W-RepMBB parameters of the locally reparameterizable multi-branch representation.

[0013] S3. Obtain the underwater RGB image to be enhanced; and resize, normalize, and tensorize it to obtain the input tensor.

[0014] S4. The shallow feature extraction module performs initial encoding on the low-level texture details and color mapping cues of the input tensor to obtain the output shallow features.

[0015] S5. Perform step-by-step encoding downsampling and feature transformation on the shallow features obtained in step S4 to form multi-scale pyramid features;

[0016] S6. At the deepest bottleneck, perform bottleneck projection free sparse expert global modeling on the third encoded feature of the multi-scale pyramid feature to introduce global context and improve the adaptability to multi-type degenerate distributions, and obtain the bottleneck output.

[0017] S7. The bottleneck output is decoded and reconstructed step by step to restore the spatial resolution, and channel splicing and skipping fusion are performed with the scale features corresponding to the encoder to obtain the final reconstructed features.

[0018] S8. The final reconstructed features are mapped back to the RGB image space through the output reconstruction head to obtain the intermediate output; the intermediate output is normalized to the [0,1] interval through tanh form or equivalent mapping to obtain the enhanced image;

[0019] S9. Output the enhanced image to a display device or write it to a storage medium to complete the underwater image enhancement process.

[0020] Furthermore, the step of training and enhancing network parameters θ in step S1 specifically includes the following sub-steps:

[0021] S11. Divide the network parameter set into four functional partitions: g_ss, g_ds, g_pf, and g_us. Set independent outer learning rates for each of the four partitions to achieve targeted adjustment.

[0022] S12. In each iteration, the current mini-batch sample set is split into two parts along the batch dimension, which are used as the meta-training subset and the meta-test subset, respectively.

[0023] S13. Define the total loss function L, L = λ1·L_rec + λ2·L_lb, where L_rec represents the reconstruction or consistency loss used to enhance quality, L_lb represents the load balancing regularization term used for sparse route stability, and λ1 and λ2 represent adjustable weights.

[0024] S14. Calculate the gradient based on the loss function L on the meta-training subset, and simultaneously perform gradient descent update on the four partitions in step S11 to obtain the temporary parameter θ′.

[0025] S15. Calculate the outer target using the temporary parameter θ′ on the meta-test subset, and perform outer update on the enhanced network parameter θ;

[0026] S16. Introduce load balancing constraints or equivalent regularization terms into the training loss to fully utilize the capacity of the shared expert pool, suppress expert route collapse and promote balanced expert utilization, thereby improving stability against changes in degenerate distribution.

[0027] S17. Repeat steps S12-S16 until the preset stopping condition is met, obtain the final enhanced network parameters θ and write them into the memory. The preset stopping condition includes reaching the number of iterations or meeting the convergence threshold.

[0028] Preferably, the LGM-Net model adopts a U-Net encoder-decoder structure.

[0029] Preferably, step S2 specifically includes: folding the multi-branch structure of the training state into a single convolutional structure to reduce inference computation and latency; wherein the single convolutional structure and the multi-branch structure are equivalent in output.

[0030] Preferably, step S4 specifically includes: the shallow feature extraction module is composed of several locally reproducible parametric multi-branch representations (W-RepMBB) stacked together, and the shallow feature extraction module performs initial encoding on the low-level texture details and color mapping cues of the input tensor I. Obtain shallow output features , This represents the first lightweight feature transformation.

[0031] Preferably, step S5 specifically includes: the encoder used for progressive encoding downsampling comprises three downsampling paths, used to progressively reduce resolution, expand the receptive field, and extract more stable semantic or structural representations; that is... , , ,in This represents the 2× downsampling operator. Indicates the first coding feature, This represents the second lightweight feature transformation. Indicates the second coding feature, This represents the third lightweight feature transformation. Indicates the third coding feature, This represents the fourth lightweight feature transformation.

[0032] Preferably, in step S6, bottleneck projection free sparse expert global modeling is performed on the third encoded feature of the multi-scale pyramid feature at the deepest bottleneck to obtain the bottleneck output feature. ,Right now ,in The bottleneck projection free sparse expert global modeling operator includes the following steps:

[0033] S61, Unprojected Q, K, V Construction: The highest-level features are divided into the first query feature Q, the first key feature K, and the first value feature V along the channel dimension for subsequent attention calculation;

[0034] S62. Shared Sparse Expert Conditional Modulation: The same shared expert pool is invoked for query feature Q, key feature K, and value feature V respectively. The shared expert pool is used to conditionally enhance different degenerate distributions. Based on the gating network, an expert probability distribution is generated, and the expert with the highest probability is selected through Top-1 routing. The corresponding features are transformed to obtain the second query feature Q′, the second key feature K′, and the second value feature V′. The Top-1 routing means that only the expert with the highest probability is selected to participate in the transformation, so as to reduce the computational overhead and realize dynamic expert selection.

[0035] S63. Attention Fusion: Flatten the spatial dimension into a sequence feature unit token sequence, and perform attention aggregation on the second query feature Q′, the second key feature K′ and the second value feature V′ to obtain a globally enhanced representation;

[0036] S64, Lightweight Projection and Shape Restoration: The attention output is mapped back to the main channel and restored to the form of a feature map through a lightweight projection layer, resulting in the bottleneck output.

[0037] Preferably, each decoding stage in step S7 consists of upsampling, concatenation, and W-RepMBB stacking, specifically including: the decoder recovers the spatial resolution step by step through three layers of upsampling paths, and performs channel concatenation fusion with the corresponding scale features of the encoder, i.e. , , ,in Indicates the first reconstruction mapping, Indicates the second reconstruction mapping, This represents the third reconstruction mapping. Indicates 2× upsampling, Indicates channel splicing. This represents the first layer upsampled features. This represents the features sampled at the second layer. This indicates the final reconstructed features.

[0038] Preferably, in step S8, the final reconstructed features are mapped back to the RGB image space through the output reconstruction head to obtain an intermediate output; the intermediate output is normalized to the [0,1] interval through tanh form or equivalent mapping to obtain the enhanced image. ,Right now , ,in Indicates output reconstruction header, Represents the normalized mapping function. This indicates scaling, translation, and normalization. This represents the hyperbolic tangent function.

[0039] The beneficial effects of this invention are:

[0040] 1) Enhanced quality: W-RepMBB provides diverse local representations, while PF-BEAM supplements global dependency modeling at bottlenecks, which can simultaneously improve color naturalness, contrast and detail clarity, and effectively alleviate structural artifacts and local over-enhancement problems.

[0041] 2) Enhanced cross-domain robustness: P2MO's partitioned second-order optimization enables different functional modules to obtain more matched update methods, improving the generalization ability and rapid adaptation ability under degradation distribution shifts across water areas and imaging conditions.

[0042] 3) Higher deployment efficiency: W-RepMBB can be equivalently folded into a single-branch convolution during the inference stage, and PF-BEAM uses unprojected attention and sparse expert routing to reduce computational overhead, thereby reducing the number of parameters and inference latency while ensuring quality, making it suitable for edge and real-time applications.

[0043] 4) Strong engineering applicability: This application can be deployed on platforms such as underwater robots, unmanned underwater vehicles, and marine monitoring camera equipment for underwater image preprocessing, target recognition / detection pre-enhancement, video enhancement, and other scenarios. Attached Figure Description

[0044] Figure 1 This is a schematic diagram illustrating the steps of the underwater image enhancement method based on lightweight global context modeling and partition meta-optimization according to an embodiment of the present invention;

[0045] Figure 2 This is a schematic diagram of the LGM-Net model framework according to an embodiment of the present invention. Detailed Implementation

[0046] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0047] See Figure 1-2 This application discloses an underwater image enhancement method based on lightweight global context modeling and partition meta-optimization, suitable for execution on computer devices (including processors and memory), to improve the color naturalness, contrast, and structural clarity of underwater images while maintaining end-side deployment efficiency, and to enhance the adaptability to degradation distribution shifts across water areas, including the following steps:

[0048] S1. Model parameter loading: Read the pre-trained augmented network parameters θ from the memory and then load them into the LGM-Net model. The augmented network parameters θ include the W-RepMBB parameters of the local reproducible multi-branch representation of the shallow, encoding, and decoding paths, the shared sparse expert pool parameters and gating parameters of the bottleneck global consistency modeling module, and the output reconstruction head parameters.

[0049] S2, Deployment-state structural reparameterization: When the LGM-Net model is used for edge or real-time inference deployment, structural reparameterization is performed on the W-RepMBB parameters of the locally reparameterizable multi-branch representation.

[0050] S3. Input Acquisition and Preprocessing: Acquire the underwater RGB image to be enhanced; and resize, normalize and tensor it to obtain the input tensor; for example, the underwater RGB image to be enhanced can be uniformly scaled to a preset resolution (e.g., 256×256) and the pixel values ​​can be normalized to [0,1] or equivalent range;

[0051] S4. Shallow Feature Extraction: The shallow feature extraction module performs initial encoding on the low-level texture details and color mapping cues of the input tensor to obtain the output shallow features.

[0052] S5. Multi-scale coding downsampling: The shallow features obtained in step S4 are subjected to step-by-step coding downsampling and feature transformation to form multi-scale pyramid features;

[0053] S6. Bottleneck Projection Free Sparse Expert Global Modeling: At the deepest bottleneck, bottleneck projection free sparse expert global modeling is performed on the third encoded feature of the multi-scale pyramid feature to introduce global context and improve the adaptability to multi-type degenerate distributions, and obtain the bottleneck output.

[0054] S7. Step-by-step decoding and reconstruction and skip-connection fusion: Step-by-step decoding and reconstruction of the bottleneck output is performed to restore the spatial resolution, and channel splicing and skip-connection fusion are performed with the scale features corresponding to the encoder to obtain the final reconstructed features.

[0055] S8. Output Mapping and Normalization: The final reconstructed features are mapped back to the RGB image space through the output reconstruction head to obtain the intermediate output; the intermediate output is normalized to the [0,1] interval through tanh form or equivalent mapping to obtain the enhanced image;

[0056] S9. Output and storage or display: Output the enhanced image to a display device or write it to a storage medium to complete the underwater image enhancement process.

[0057] For example, the step of training and enhancing network parameters θ in step S1 specifically includes the following sub-steps:

[0058] S11. Parameter Partitioning and Differentiated Outer Learning Rates: The network parameter set is functionally divided into four partitions: g_ss (shallow layer and output mapping parameters), g_ds (encoding downsampling path parameters), g_pf (PF-BEAM and shared sparse expert pool related parameters), and g_us (decoding upsampling path parameters). Independent outer learning rates are set for each partition: η_ss for the first partition, η_ds for the second, η_pf for the third, and η_us for the fourth. This allows for targeted adjustments; for example, the Adam optimizer can be used to set different learning rates for each partition (e.g., η_ss is higher than η_ds, η_pf, and η_us) to prioritize stabilizing low-level color mapping and detail recovery.

[0059] S12. Constructing meta-training or meta-test subsets within a batch: During each iteration, the current mini-batch sample set is split into two parts along the batch dimension, which are used as the meta-training subset and the meta-test subset, respectively. This intra-batch partitioning can simulate the slight shift between the training distribution and the test distribution without additional data partitioning, thereby improving the cross-scenario generalization ability.

[0060] S13. Definition of training objective: Define the total loss function L, L=λ1·L_rec+λ2·L_lb, where L_rec represents the reconstruction or consistency loss used to enhance quality, L_lb represents the load balancing regularization term used for sparse route stability, and λ1 and λ2 represent adjustable weights.

[0061] S14. Inner layer fast adaptive update: Calculate the gradient based on the loss function L on the meta-training subset, and simultaneously perform gradient descent update on the four partitions in step S11 to obtain temporary parameters θ′; the temporary parameters are used for subsequent outer layer target calculation and are not directly written back to the original parameters θ.

[0062] S15, Second-order outer layer update: Calculate the outer layer target using the temporary parameter θ′ on the meta-test subset, and perform outer layer update on the enhanced network parameter θ described in step S1; Since θ′ is indirectly obtained from θ through gradient update, the outer layer update forms a second-order or approximately second-order meta-optimization process, enabling the model to quickly adapt with a small number of gradient updates;

[0063] S16, PF-BEAM load balancing constraint: Introduce load balancing constraints or equivalent regularization terms into the training loss to make full use of the shared expert pool capacity, suppress expert route collapse and promote balanced expert utilization, thereby improving stability against changes in degenerate distribution.

[0064] S17. Training Termination and Parameter Fixation: Repeat steps S12-S16 until the preset stopping condition is met, obtain the final network parameters θ and write them into the memory. The preset stopping condition includes reaching the number of iterations or meeting the convergence threshold.

[0065] For example, the LGM-Net model adopts a U-Net-style encoder-decoder structure (U-Net style) and fuses shallow high-resolution details with deep semantic information through layer-by-layer skip-connections. In its structural implementation, W-RepMBB serves as the unified basic feature unit across the entire network: it is used not only for shallow feature extraction (SS), convolutional stacking of downsampling encoding at each level (DS1–DS3), and upsampling decoding (US3–US1), but also embedded in the expert enhancement path of PF-BEAM as a lightweight local detail-structure enhancement operator. The end-to-end enhancement process of LGM-Net can be summarized as follows: ,in This represents the input underwater image to be enhanced. This represents the set of model parameters for the augmented network. This represents the end-to-end enhancement mapping function composed of SS–DS1–DS3–PF-BEAM–US3–US1–output reconstruction heads concatenated. To enhance the image, W-RepMBB provides consistent lightweight local representation primitives, PF-BEAM supplements the global consistency modeling at the bottleneck, and the P2MO partitioning primitive optimization strategy on the training side is used to further improve the model's ability to adapt quickly across degenerate distributions and small sample scenarios.

[0066] Specifically, in the LGM-Net model, a unified design chain is constructed: "Locally Reproducible Parameter Multi-Branch Representation (W-RepMBB) → Projected Free Sparse Expert Global Modeling (PF-BEAM) → Partitioned Second-Order Optimization Training (P2MO)". This chain improves local detail recovery, global color / structure consistency, and generalization ability across degenerate distributions without significantly increasing inference overhead.

[0067] W-RepMBB (Weighted Re-parameterized Multi-Branch Block): During the training phase, it employs multi-branch parallel transformation and learnable fusion weights; during the inference phase, it folds the multi-branch into a single convolution to improve deployment efficiency; it is used for lightweight local feature extraction and detail enhancement.

[0068] PF-BEAM (Projection-Free BottleneckSparse-Expert Attention Module): It uses a projection-free Q, K, V structure to reduce attention overhead, and combines Top-1 routing and load balancing constraints with a shared sparse expert pool to achieve conditional global consistency correction; it is used to introduce a global context and perform conditional enhancement at the bottleneck layer.

[0069] P2MO (Partitioned Second-Order Meta-Optimization) divides parameters into four partitions based on their function: g_ss, g_ds, g_pf, and g_us. Based on intra-batch meta-training / meta-testing construction and second-order outer layer updates, it learns initialization and update strategies that are more adaptable to cross-degenerate distribution shifts. It is used to set differentiated meta-updates for different parameter partitions during the training phase to improve cross-degenerate adaptation capabilities.

[0070] Figure 2 Some module names are represented by English letters or abbreviations, and their meanings are explained below:

[0071] 1) SS: Shallow feature extraction stage;

[0072] 2) DS1 / DS2 / DS3: Down-Sampling encoding stage 1 / 2 / 3;

[0073] 3) US3 / US2 / US1: Up-Sampling decoding stage 3 / 2 / 1;

[0074] 4) Conv2d: Two-dimensional convolutional layer;

[0075] 5) MaxPool2d: Two-dimensional max pooling layer (2D Max Pooling);

[0076] 6) Concat: Concatenation operation by channel dimension;

[0077] 7) LeakyReLU: Leaky Rectified LinearUnit activation function with leakage coefficient;

[0078] 8) Chunk: Channel splitting or block operation, used to divide features into multiple sub-tensors in the channel dimension (e.g., constructing Q, K, V).

[0079] 9) MoE: Mixture of Experts, refers to a conditional computation structure composed of multiple expert subnetworks selected through gating;

[0080] 10) Attn: Attention computation, used for global context aggregation of sequence features;

[0081] 11) tanh: hyperbolic tangent function, used to scale and normalize the output to the [0,1] interval (or equivalent mapping).

[0082] Step-by-step reconstruction: The decoding stage adopts a reconstruction mapping of "upsampling + stitching + W-RepMBB stacking" to balance high-resolution detail restoration and deep structural constraints, thereby suppressing pseudo-textures and local over-enhancement.

[0083] For example, step S2 specifically includes: folding the multi-branch structure of the training state into a single convolutional structure to reduce inference computation and latency; wherein the single convolutional structure and the multi-branch structure are equivalent in output.

[0084] For example, step S4 specifically includes: the shallow feature extraction module is composed of several locally reproducible parametric multi-branch representations (W-RepMBB) stacked together, used to expand the receptive field and extract more stable structural or semantic representations; the shallow feature extraction module performs initial encoding on the low-level texture details and color mapping cues of the input tensor I. Obtain shallow output features , This represents the first lightweight feature transformation.

[0085] For example, step S5 specifically includes: the encoder used for progressive encoding downsampling contains a three-layer downsampling path, progressively reducing resolution, expanding the receptive field, and extracting more stable semantic or structural representations; that is... , , ,in This represents the 2× downsampling operator. Indicates the first coding feature, This represents the second lightweight feature transformation. Indicates the second coding feature, This represents the third lightweight feature transformation. Indicates the third coding feature, This represents the fourth lightweight feature transformation.

[0086] For example, in step S6, bottleneck projection free sparse expert global modeling is performed on the third encoded feature of the multi-scale pyramid feature at the deepest bottleneck to obtain the bottleneck output feature. ,Right now ,in The bottleneck projection free sparse expert global modeling operator introduces a global context and improves the adaptability to multiple types of degenerate distributions. Specifically, it includes the following steps:

[0087] S61, Unprojected Q, K, V Construction: The highest-level features are divided into Q, K, and V along the channel dimension; where Q represents the query feature, K represents the key feature, and V represents the value feature, which are used for subsequent attention calculation;

[0088] S62. Shared Sparse Expert Conditional Modulation: The same shared expert pool is invoked for Q, K, and V respectively. Expert probability distributions are generated based on a gated network, and the expert with the highest probability is selected through Top-1 routing to transform the corresponding features, resulting in Q′, K′, and V′. The shared expert pool is used for conditional enhancement of different degenerate distributions, and Top-1 routing indicates that only the expert with the highest probability is selected for transformation, reducing computational overhead and achieving dynamic expert selection.

[0089] S63. Attention Fusion: Flatten the spatial dimension into a sequence of tokens (sequence feature units), and perform attention aggregation on Q′, K′, and V′ to obtain a globally enhanced representation;

[0090] S64, Lightweight Projection and Shape Restoration: The attention output is mapped back to the main channel and restored to the form of a feature map through a lightweight projection layer, resulting in the bottleneck output.

[0091] For example, each decoding stage in step S7 consists of upsampling, stitching, and W-RepMBB stacking, generating reconstructed features step by step, balancing high-resolution detail restoration with deep structural constraints to suppress pseudo-textures and local over-enhancement; specifically, it includes: the decoder recovers spatial resolution step by step through three upsampling paths, and performs skip-connection fusion with the corresponding scale features of the encoder through channel stitching, i.e. , , ,in Indicates the first reconstruction mapping, Indicates the second reconstruction mapping, This represents the third reconstruction mapping. Indicates 2× upsampling, Indicates channel splicing. This represents the first layer upsampled features. This represents the features sampled at the second layer. This indicates the final reconstructed features.

[0092] For example, in step S8, the final reconstructed features are mapped back to the RGB image space through the output reconstruction head to obtain an intermediate output; the intermediate output is normalized to the [0,1] interval through tanh form or equivalent mapping to obtain the enhanced image. ,Right now , ,in Indicates output reconstruction header, This represents the normalization mapping function (which normalizes the intermediate output to the [0,1] interval). This indicates scaling, translation, and normalization. This represents the hyperbolic tangent function.

[0093] The above description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the concept described herein through the above teachings or related technologies or knowledge. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. An underwater image enhancement method based on lightweight global context modeling and partition meta-optimization, characterized in that, Includes the following steps: S1. Read the pre-trained augmented network parameters θ from the memory and then load them into the LGM-Net model. The augmented network parameters θ include the W-RepMBB parameters of the local reproducible multi-branch representation of the shallow, encoding, and decoding paths, the shared sparse expert pool parameters and gating parameters of the bottleneck global consistency modeling module, and the output reconstruction head parameters. S2. When the LGM-Net model is used for edge or real-time inference deployment, structural reparameterization is performed on the W-RepMBB parameters of the locally reparameterizable multi-branch representation. S3. Obtain the underwater RGB image to be enhanced; and resize, normalize, and tensorize it to obtain the input tensor. S4. The shallow feature extraction module performs initial encoding on the low-level texture details and color mapping cues of the input tensor to obtain the output shallow features. S5. Perform step-by-step encoding downsampling and feature transformation on the shallow features obtained in step S4 to form multi-scale pyramid features; S6. At the deepest bottleneck, perform bottleneck projection free sparse expert global modeling on the third encoded feature of the multi-scale pyramid feature to introduce global context and improve the adaptability to multi-type degenerate distributions, and obtain the bottleneck output. S7. The bottleneck output is decoded and reconstructed step by step to restore the spatial resolution, and channel splicing and skipping fusion are performed with the scale features corresponding to the encoder to obtain the final reconstructed features. S8. The final reconstructed features are mapped back to the RGB image space through the output reconstruction head to obtain the intermediate output; the intermediate output is normalized to the [0,1] interval through tanh form or equivalent mapping to obtain the enhanced image; S9. Output the enhanced image to a display device or write it to a storage medium to complete the underwater image enhancement process; Step S4 specifically includes: the shallow feature extraction module is composed of several locally reproducible parametric multi-branch representations (W-RepMBB) stacked together, and the shallow feature extraction module performs initial encoding on the low-level texture details and color mapping cues of the input tensor I. Obtain shallow output features , This represents the first lightweight feature transformation; Step S5 specifically includes: the encoder used for progressive encoding downsampling contains three downsampling paths, used to progressively reduce resolution, expand the receptive field, and extract more stable semantic or structural representations; that is... , , ,in This represents the 2× downsampling operator. Indicates the first coding feature, This represents the second lightweight feature transformation. Indicates the second coding feature, This represents the third lightweight feature transformation. Indicates the third coding feature, This represents the fourth lightweight feature transformation; In step S6, bottleneck projection free sparse expert global modeling is performed on the third encoded feature of the multi-scale pyramid feature at the deepest bottleneck to obtain the bottleneck output feature. ,Right now ,in The bottleneck projection free sparse expert global modeling operator includes the following steps: S61, Unprojected Q, K, V Construction: The highest-level features are divided into the first query feature Q, the first key feature K, and the first value feature V along the channel dimension for subsequent attention calculation; S62. Shared Sparse Expert Conditional Modulation: The same shared expert pool is invoked for query feature Q, key feature K, and value feature V respectively. The shared expert pool is used to conditionally enhance different degenerate distributions. Based on the gating network, an expert probability distribution is generated, and the expert with the highest probability is selected through Top-1 routing. The corresponding features are transformed to obtain the second query feature Q′, the second key feature K′, and the second value feature V′. The Top-1 routing means that only the expert with the highest probability is selected to participate in the transformation, so as to reduce the computational overhead and realize dynamic expert selection. S63. Attention Fusion: Flatten the spatial dimension into a sequence feature unit token sequence, and perform attention aggregation on the second query feature Q′, the second key feature K′ and the second value feature V′ to obtain a globally enhanced representation; S64, Lightweight Projection and Shape Restoration: The attention output is mapped back to the main channel and restored to the form of a feature map through a lightweight projection layer, resulting in the bottleneck output.

2. The underwater image enhancement method based on lightweight global context modeling and partition meta-optimization according to claim 1, characterized in that, Step S1, which involves training and enhancing network parameters θ, specifically includes the following sub-steps: S11. Divide the network parameter set into four functional partitions: g_ss, g_ds, g_pf, and g_us. Set independent outer layer learning rates for each of the four partitions to achieve targeted adjustment. The first partition, g_ss, contains the shallow layer and output mapping parameters; the second partition, g_ds, contains the encoding downsampling path parameters; the third partition, g_pf, contains the PF-BEAM and shared sparse expert pool related parameters; and the fourth partition, g_us, contains the decoding upsampling path parameters. S12. In each iteration, the current mini-batch sample set is split into two parts along the batch dimension, which are used as the meta-training subset and the meta-test subset, respectively. S13. Define the total loss function L, L = λ1·L_rec + λ2·L_lb, where L_rec represents the reconstruction or consistency loss used to enhance quality, L_lb represents the load balancing regularization term used for sparse route stability, and λ1 and λ2 represent adjustable weights. S14. Calculate the gradient based on the loss function L on the meta-training subset, and simultaneously perform gradient descent update on the four partitions in step S11 to obtain the temporary parameter θ′. S15. Calculate the outer target using the temporary parameter θ′ on the meta-test subset, and perform outer update on the enhanced network parameter θ; S16. Introduce load balancing constraints or equivalent regularization terms into the training loss to fully utilize the capacity of the shared expert pool, suppress expert route collapse and promote balanced expert utilization, thereby improving stability against changes in degenerate distribution. S17. Repeat steps S12-S16 until the preset stopping condition is met, obtain the final enhanced network parameters θ and write them into the memory. The preset stopping condition includes reaching the number of iterations or meeting the convergence threshold.

3. The underwater image enhancement method based on lightweight global context modeling and partition meta-optimization according to claim 2, characterized in that: The LGM-Net model adopts a U-Net-style encoder-decoder structure.

4. The underwater image enhancement method based on lightweight global context modeling and partition meta-optimization according to claim 3, characterized in that, Step S2 specifically includes: folding the multi-branch structure of the training state into a single convolutional structure to reduce inference computation and latency; wherein the single convolutional structure and the multi-branch structure are equivalent in output.

5. The underwater image enhancement method based on lightweight global context modeling and partition meta-optimization according to claim 4, characterized in that, Each decoding stage in step S7 consists of upsampling, concatenation, and W-RepMBB stacking. Specifically, it includes: the decoder recovers the spatial resolution step by step through three layers of upsampling paths, and performs skip-connection fusion by concatenating the corresponding scale features of the encoder. , , ,in Indicates the first reconstruction mapping, Indicates the second reconstruction mapping, This represents the third reconstruction mapping. Indicates 2× upsampling, Indicates channel splicing. This represents the first layer upsampled features. This represents the features sampled at the second layer. This indicates the final reconstructed features.

6. The underwater image enhancement method based on lightweight global context modeling and partition meta-optimization according to claim 5, characterized in that, In step S8, the final reconstructed features are mapped back to the RGB image space using the output reconstruction head to obtain the intermediate output; the intermediate output is then normalized to the [0,1] interval using tanh form or equivalent mapping to obtain the enhanced image. ,Right now , ,in Indicates output reconstruction header, Represents the normalized mapping function. This indicates scaling, translation, and normalization. This represents the hyperbolic tangent function.