Low-light image enhancement method and device in combination with adaptive gamma learning and attention network

By combining adaptive gamma learning with attention networks, the disconnect between global brightness adjustment and local detail restoration in low-light image enhancement is solved, achieving image enhancement effects that balance brightness and preserve detail.

CN122048758APending Publication Date: 2026-05-15浙江交投高速公路运营管理有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
浙江交投高速公路运营管理有限公司
Filing Date
2026-01-14
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing technologies cannot simultaneously meet the needs of global brightness adjustment and local detail restoration in low-light image enhancement, resulting in insufficient lighting balance, detail fidelity, and color naturalness.

Method used

By combining adaptive gamma learning with attention networks, and through feature extraction, global context fusion, adaptive gamma correction, and attention-enhanced encoder-decoder networks, multiple loss functions are used to optimize image enhancement, achieving brightness adjustment and detail optimization.

Benefits of technology

It achieves global brightness equalization and local detail restoration in low-light images, improving image quality, especially in brightness equalization, detail fidelity, and color naturalness, outperforming other methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122048758A_ABST
    Figure CN122048758A_ABST
Patent Text Reader

Abstract

The invention is suitable for the field of computer vision, and provides a low-light image enhancement method and device in combination with adaptive gamma learning and an attention network. In the embodiment of the invention, feature extraction and global context fusion are firstly carried out on a low-light image needing to be enhanced, and a pixel-level adaptive gamma correction graph is obtained; adjusting the brightness of the low-light image through the correction image to obtain a preliminary enhanced image; and then detail color optimization and noise suppression are carried out on the preliminarily enhanced image through an attention enhancement encoder-decoder network supervised by loss functions such as ensuring pixel-level precision and suppressing color distortion, loss optimization is carried out through a multi-loss function, and finally an enhanced image of the low-light image is obtained. According to the invention, through adaptive brightness adjustment and attention-guided detail restoration, the problem that global brightness adjustment and local detail restoration are disjointed and the enhancement requirements of illumination balance, detail fidelity and color naturalness are difficult to meet at the same time can be solved, and the quality of the enhanced low-light image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer vision, and more particularly to a method and apparatus for low-light image enhancement that combines adaptive gamma learning with attention networks. Background Technology

[0002] Images acquired in low-light environments suffer from problems such as amplified noise, insufficient illumination, reduced contrast, color distortion, and loss of detail, severely impacting the performance of computer vision tasks such as target recognition and scene analysis. These images are widely used in fields such as surveillance and security, autonomous driving, and nighttime photography; therefore, low-light image enhancement technology has become a research hotspot in the field of computer vision.

[0003] In recent years, diffusion models, attention mechanisms, and adaptive gamma correction techniques have demonstrated significant advantages in image enhancement tasks. Some methods combine diffusion models with Retinex theory to achieve physically inspired generative enhancement; others address non-uniform illumination problems by learning pixel-level gamma maps, but neglect the synergistic optimization of detail restoration and noise suppression. However, existing techniques generally suffer from a disconnect between global brightness adjustment and local detail restoration, making it difficult to simultaneously meet the enhancement requirements of balanced illumination, faithful detail, and natural color. Summary of the Invention

[0004] In view of this, this application provides a low-light image enhancement method and apparatus that combines adaptive gamma learning and attention network to solve the problem that global brightness adjustment and local detail restoration are disconnected, making it difficult to simultaneously meet the enhancement requirements of illumination balance, detail fidelity and color naturalness, thereby improving the quality of the enhanced low-light image.

[0005] The first aspect of this application provides a low-light image enhancement method combining adaptive gamma learning and attention networks, the method comprising: Feature extraction is performed on the low-light image that needs to be enhanced. Global context fusion is then performed on the extracted features to obtain context-enhanced features. The adaptive gamma correction map of the low-light image is then obtained through the context-enhanced features. The low-light image is brightness adjusted using the adaptive gamma correction map to obtain a preliminary enhanced image with global brightness balance. The initial enhanced image is optimized for detail and color using an attention-enhanced encoder-decoder network to obtain a target enhanced image. Then, the target enhanced image is optimized for loss using a multi-loss function determined by several loss functions to obtain the final enhanced image. The several loss functions include an L1 reconstruction loss function to ensure pixel-level accuracy, an SSIM loss function to maintain structural similarity, a TV loss function to promote spatial smoothness, a color constancy loss function to suppress color distortion, and a gamma regularization loss function to stabilize gamma values.

[0006] Optionally, the feature extraction of the low-light image that needs enhancement includes: Feature extraction is performed using a three-level 3×3 convolutional layer, with the following formula: in, For the low-light image, The extracted local texture features are shown, where H and W represent the height and width of the image, respectively. This represents a 3×3 convolution operation, BN represents batch normalization, and ReLU represents the activation function. .

[0007] Optionally, the step of performing global context fusion on the extracted features to obtain context-enhanced features includes: Adaptive average pooling is performed on the extracted features to obtain the global brightness descriptor. ; The global brightness descriptor G is processed by two levels of 1×1 convolution to obtain channel attention weights. Then, the channel attention weights are multiplied point by point with the extracted features to obtain the context-enhanced features.

[0008] Optionally, adjusting the brightness of the low-light image using the adaptive gamma correction map includes: Through formula An adaptive gamma correction map is used to adjust the brightness of the low-light image, where ε = 10^{-6}. The adaptive gamma correction diagram is shown below. This is the initial enhanced image.

[0009] Optionally, the detail and color optimization of the initially enhanced image through the attention-enhanced encoder-decoder network includes: Determine the average channel feature extracted by global average pooling and the maximum channel feature extracted by global max pooling, and determine the channel weights using the average channel feature and the maximum channel feature; Spatial weights are determined based on the channel weights, attention enhancement features are then determined based on the spatial weights, and finally, an enhanced image for detail and color optimization is determined based on the attention enhancement features.

[0010] Optionally, the loss optimization of the target enhancement image using a multi-loss function determined based on several loss functions includes: The preliminary enhanced image and the preset normal light image are used as input parameters for the L1 reconstruction loss function, SSIM loss function, TV loss function, color constancy loss function and gamma regularization loss function to obtain the loss of the preliminary enhanced image; The target enhanced image and the preset normal light image are used as input parameters for the L1 reconstruction loss function, SSIM loss function, TV loss function, color constancy loss function and gamma regularization loss function to obtain the loss of the target enhanced image; The total loss is determined based on the loss of the initial enhanced image and the loss of the target enhanced image, and then the target enhanced image is optimized using the total loss.

[0011] A second aspect of this application provides a low-light image enhancement device combining adaptive gamma learning and an attention network, the device comprising: The gamma correction image determination unit is used to extract features from the low-light image that needs to be enhanced, perform global context fusion on the extracted features to obtain context enhancement features, and then obtain the adaptive gamma correction image of the low-light image through the context enhancement features. The first enhancement unit is used to adjust the brightness of the low-light image using the adaptive gamma correction map to obtain a preliminary enhanced image with global brightness balance. The second enhancement unit is used to optimize the details and colors of the preliminary enhanced image through an attention-enhanced encoder-decoder network to obtain a target enhanced image. Then, the target enhanced image is optimized for loss through a multi-loss function determined based on several loss functions to obtain a final enhanced image. The several loss functions include an L1 reconstruction loss function to ensure pixel-level accuracy, an SSIM loss function to maintain structural similarity, a TV loss function to promote spatial smoothness, a color constancy loss function to suppress color distortion, and a gamma regularization loss function to stabilize gamma values.

[0012] Optionally, the feature extraction of the low-light image requiring enhancement in the gamma correction image determination unit includes: Feature extraction is performed using a three-level 3×3 convolutional layer, with the following formula: in, For the low-light image, The extracted local texture features are shown, where H and W represent the height and width of the image, respectively. This represents a 3×3 convolution operation, BN represents batch normalization, and ReLU represents the activation function. ; The step of performing global context fusion on the extracted features to obtain context-enhanced features includes: Adaptive average pooling is performed on the extracted features to obtain the global brightness descriptor. ; The global brightness descriptor G is processed by two levels of 1×1 convolution to obtain channel attention weights. Then, the channel attention weights are multiplied point by point with the extracted features to obtain the context-enhanced features.

[0013] Optionally, the brightness adjustment of the low-light image using the adaptive gamma correction map in the first enhancement unit includes: Through formula An adaptive gamma correction map is used to adjust the brightness of the low-light image, where ε = 10^{-6}. The adaptive gamma correction diagram is shown below. This is the initial enhanced image.

[0014] Optionally, the loss optimization of the target enhanced image by using a multi-loss function determined based on several loss functions in the second enhancement unit includes: The preliminary enhanced image and the preset normal light image are used as input parameters for the L1 reconstruction loss function, SSIM loss function, TV loss function, color constancy loss function and gamma regularization loss function to obtain the loss of the preliminary enhanced image; The target enhanced image and the preset normal light image are used as input parameters for the L1 reconstruction loss function, SSIM loss function, TV loss function, color constancy loss function and gamma regularization loss function to obtain the loss of the target enhanced image; The total loss is determined based on the loss of the initial enhanced image and the loss of the target enhanced image, and then the target enhanced image is optimized using the total loss.

[0015] In the embodiments provided in this application, for a low-light image requiring enhancement, feature extraction and global context fusion are first performed to obtain a pixel-level adaptive gamma correction map. Then, the brightness of the low-light image is adjusted using this correction map to obtain a preliminary enhanced image. Next, an attention-guided encoder-decoder network, supervised by loss functions that ensure pixel-level accuracy and suppress color distortion, performs detail color optimization and noise suppression on this preliminary enhanced image. Loss optimization is then performed using multiple loss functions to finally obtain the enhanced low-light image. This application, through adaptive brightness adjustment and attention-guided detail restoration, solves the problem of the disconnect between global brightness adjustment and local detail restoration, making it difficult to simultaneously meet the enhancement requirements of illumination balance, detail fidelity, and natural color, thus improving the quality of the enhanced low-light image. Attached Figure Description

[0016] Figure 1 A flowchart illustrating the method provided in this application embodiment; Figure 2 This is a schematic diagram of the image processing process provided in the embodiments of this application; Figure 3 This is a diagram of the U-Net architecture provided in the embodiments of this application; Figure 4 A visual comparison diagram of the enhancement effects of various methods under low-light conditions provided in the embodiments of this application; Figure 5 Visual comparison diagrams of the enhancement effects of various methods under dark conditions provided in the embodiments of this application; Figure 6 This is a structural diagram of the device provided in the embodiments of this application; Figure 7 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0017] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0018] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0019] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0020] This application first describes existing low-light image enhancement methods.

[0021] Existing technologies are mainly divided into two categories: classical image processing methods and deep learning methods. However, both types of methods have significant drawbacks when dealing with extreme low-light scenes.

[0022] 1. Traditional low-light image enhancement techniques are mainly based on classical image processing theories: histogram equalization improves contrast by redistributing pixel intensity, but it easily leads to over-enhancement and noise amplification; Retinex theory, based on illumination and reflectivity decomposition models, enhances visibility through logarithmic transformation, but relies on fixed filtering strategies and has limited robustness; optimization methods achieve enhancement by estimating illumination maps and iteratively optimizing, but are prone to edge noise under colored lighting conditions. However, traditional methods rely excessively on hand-designed rules and idealized assumptions, making it difficult to balance brightness enhancement and detail preservation in complex real-world scenes.

[0023] 2. Deep learning methods are mainly divided into two categories: supervised learning and unsupervised learning. Supervised learning methods construct an end-to-end mapping by minimizing the difference between the augmented image and the ground truth, but they are highly dependent on paired training data. Because acquiring high-quality normal-light-low-light image pairs is costly, training samples are scarce, easily leading to model overfitting, and their cross-scene transferability is limited. Unsupervised learning methods rely solely on the characteristics of the input image itself to drive network updates, solving the paired data dependency problem, but lacking explicit supervision signals, they are prone to getting trapped in local optima, resulting in color distortion or blurred details.

[0024] This application provides a low-light image enhancement method and apparatus to solve the problem that global brightness adjustment and local detail restoration are disconnected, making it difficult to simultaneously meet the enhancement requirements of lighting balance, detail fidelity and color naturalness.

[0025] The technical solutions of this application will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0026] like Figure 1 The diagram shown is a flowchart of a low-light image enhancement method combining adaptive gamma learning and attention networks provided in this application. The process may include the following steps: Step S101: Extract features from the low-light image that needs to be enhanced, perform global context fusion on the extracted features to obtain context-enhanced features, and then obtain the adaptive gamma correction map of the low-light image through the context-enhanced features.

[0027] In this embodiment, the low-light image requiring enhancement can be scaled down to 128×128 resolution and normalized to the range [0,1]. Then, feature extraction is performed using a three-stage 3×3 convolutional layer with 32 output channels per layer. The specific process is as follows: Acquired The extracted local texture features are shown, where H and W represent the height and width of the aforementioned low-light image, respectively. This represents a 3×3 convolution operation, BN represents batch normalization, and ReLU represents the activation function. .

[0028] Feature extraction Then, adaptive average pooling is first applied to obtain the global luminance descriptor. Then, it is processed through two stages of 1×1 convolution. The specific process is as follows: In the above formula, For channel attention weights, This represents a 1×1 convolution operation with k output channels. It is a sigmoid activation function. Then the features... and channel attention weights Pointwise multiplication involves multiplying the channel vector corresponding to each spatial location in the feature tensor with the scalar value of the corresponding channel in the attention weight vector, thereby dynamically adjusting the response intensity of each channel and ultimately generating context-aware enhanced features. The formula is , This indicates point-by-point multiplication.

[0029] Determine Enhancement Features Then, through the formula An adaptive gamma-corrected image of the aforementioned low-light image is generated. This process constrains the gamma value to [0.5, 2.0] using a scaled S-shaped activation function. Brighten the corresponding pixel at the same time. Suppress overexposure.

[0030] By following the steps described above, an adaptive gamma correction map can be obtained for adjusting the brightness of low-light images. This correction map combines local texture features with overall brightness statistics, enabling it to adaptively distinguish between bright and dark areas and avoid overexposure or underexposure.

[0031] Step S102: Adjust the brightness of the low-light image using the adaptive gamma correction image to obtain a preliminary enhanced image with global brightness balance.

[0032] In this embodiment, the low-light image and the generated adaptive gamma correction image need to be subjected to a pixel-level power transformation operation. Specifically, the value of each pixel position in the correction image is used as the gamma exponent corresponding to that position, and the brightness channel or RGB channel of the corresponding pixel in the low-light image is non-linearly mapped.

[0033] Specifically, adaptive gamma correction plot Each pixel value in Represents a spatially adaptive gamma exponent, which assigns each pixel value Compared with the above low-light images Perform a pixel-by-pixel nonlinear transformation. That is, for the image... Each pixel position (x, y) in the image is represented by its corresponding... The value is an exponent, representing the luminance component of the pixel, or it can be obtained by directly performing a power operation on each of the RGB channels to output the pixel value. This process involves... The area, i.e., the dark area, is subjected to expansive correction. Suppressive correction is applied to the bright areas, achieving adaptive reshaping of the overall dynamic range of the image. This effectively compresses overly bright areas and improves the visibility of details in overly dark areas, ultimately generating a preliminary enhanced image with a more uniform global brightness distribution and a more balanced visual experience.

[0034] In another embodiment, by formula An adaptive gamma correction map is used to adjust the brightness of the low-light image. This is for the initial image enhancement.

[0035] Due to the image There may be extremely dark areas with very little content, dominated by noise, where the pixel value... When the value is infinitely close to 0, even with enhancement, the area remains very close to a black background in terms of visual perception and numerical representation, and the enhancement process can lead to numerical instability. Therefore, this embodiment adds a constant ε during the enhancement process, which can be preset to 10^{-6}, to address this issue. The problem of numerical instability caused by values ​​close to 0.

[0036] Step S103: The initial enhanced image is optimized for detail and color through an attention-enhanced encoder-decoder network to obtain a target enhanced image. Then, the target enhanced image is optimized for loss through a multi-loss function determined by several loss functions to obtain the final enhanced image.

[0037] In this embodiment, the attention-enhanced encoder-decoder network is an improvement on the U-Net architecture, comprising encoding and decoding paths composed of DoubleConv (double convolutional blocks) and CBAM (convolutional block attention modules), as follows: Figure 3 As shown.

[0038] DoubleConv consists of two 3×3 convolutional layers, batch normalization, and modified linear unit activation functions. Where x is the input of the module, this process can be uniformly represented as In this embodiment, x represents the aforementioned preliminary enhanced image. .

[0039] The Convolutional Block Attention (CBAM) module includes a channel attention submodule and a spatial attention submodule. The channel attention submodule uses global average pooling. and global max pooling extraction Channel feature statistics: Output channel weights after shared MLP processing: The spatial attention submodule uses average pooling along the channel dimension. and max pooling Extracting spatial features: in After concatenation, the spatial weights are output via a 7×7 convolution: The final attention enhancement feature is: .

[0040] The above process can be uniformly represented as: 'x' is the input to the module, which in this case is the preliminary enhanced image described above. .

[0041] The encoding path includes four levels of double convolutional blocks and convolutional attention modules. Each level of double convolutional block is followed by max pooling (with a stride of 2) and a convolutional attention module to achieve feature downsampling and attention optimization. in The output feature of the i-th level of the encoding path is... .

[0042] The decoding path achieves feature upsampling through transposed convolutions (with a stride of 2), and fuses features at the same level from the encoding path through skip connections: in This indicates the transpose convolution operation. Indicates feature splicing, For the i-th level output feature of the decoding path, .

[0043] The final output of the decoding path Enhanced image with detail restoration obtained after 1×1 convolution and sigmoid activation. , This is the enhanced image of the aforementioned target.

[0044] Meanwhile, the loss function provides real-time supervision during the attention-enhanced encoder-decoder network's enhancement process, offering immediate feedback and gradient guidance for each step of the model's output. This dynamically optimizes the weight allocation of the attention mechanism and the quality of sequence generation. The loss functions include L1 reconstruction loss function, SSIM loss function, TV loss function, color constancy loss function, and gamma regularization loss function.

[0045] The implementation process of each loss function is explained below: 1. L1 Reconstruction Loss Function. This function is used to ensure pixel-level accuracy. The formula is: Where C is the number of channels, and H and W are the image dimensions.

[0046] 2. SSIM Loss Function. This function is used to preserve structural similarity. The formula is: in The mean, For variance, For covariance, , .

[0047] 3. TV Loss Function. This function is used to promote spatial smoothness. The formula is: 4. Color constancy loss function. This function is used to suppress color loss. The formula is: in, This is the average value of the RGB channels. .

[0048] 5. Gamma Regularization Loss Function. This function is used to stabilize the gamma value. The formula is: in, The global mean of the gamma correction plot. For the target value, .

[0049] After determining the loss function, the image will be initially enhanced. and preset normal light image As input parameters for each loss function, through the formula Determine the loss of the initial enhanced image .

[0050] Then enhance the image through the target. and preset normal light image As input parameters for each loss function, through the formula Determine the loss of the target augmented image .

[0051] Then, a multi-loss function is determined based on the loss of the initial enhanced image and the loss of the target enhanced image. The total loss is determined. Then, the network parameters are optimized through backpropagation to output the final enhanced image. The entire implementation process is as follows Figure 2 As shown.

[0052] This concludes the process. Figure 1 The process is shown below.

[0053] In this embodiment, for a low-light image that needs to be enhanced, feature extraction and global context fusion are first performed to obtain a pixel-level adaptive gamma correction map; then, the brightness of the low-light image is adjusted using this correction map to obtain a preliminary enhanced image; then, the preliminary enhanced image is optimized for detail color and noise suppression using an attention-enhanced encoder-decoder network supervised by loss functions that ensure pixel-level accuracy and suppress color distortion, and loss optimization is performed using multiple loss functions to finally obtain the enhanced image of the low-light image.

[0054] The beneficial effects of this application are at least as follows: 1. A two-stage low-light image enhancement architecture is proposed. Global brightness equalization is achieved through adaptive gamma correction of the image, and local detail restoration is achieved through attention encoding and decoding network. It can adapt to scenes with different light intensities without manual parameter adjustment.

[0055] 2. The global context fusion module combines local texture features with overall brightness statistics to generate a pixel-level gamma correction map that can adaptively distinguish between bright and dark areas, avoiding overexposure or underexposure.

[0056] 3. Introducing a convolutional block attention mechanism highlights effective features in the channel dimension and focuses on key areas in the spatial dimension, while suppressing noise interference, achieving synergistic optimization of detail fidelity and natural color.

[0057] To further illustrate the effectiveness of this invention, this embodiment compares multiple methods under identical experimental conditions. The experiment was implemented using the PyTorch framework, trained for 100 epochs using an NVIDIA-RTX 3050Ti GPU. Evaluation metrics included NIQE (No Reference Image Quality Evaluation, lower values ​​are better), BRISQUE (Blind Reference Image Quality Evaluation, lower values ​​indicate less distortion), and UNIQUE (Detail Uniqueness Evaluation, values ​​within the reasonable range of 0.5 to 1.2 are better). Image comparison results are shown below. Figure 4 , 5 As shown, Figure 4 This is a visual comparison image under low-light conditions. Figure 5 The images show a visual comparison under dark conditions. The experimental results are shown in the table below: Dataset DICM DICM DICM LIME LIME LIME MEF MEF MEF index NICQ BRISQUE UNIQUE NICQ BRISQUE UNIQUE NICQ BRISQUE UNIQUE LIME 3.75 24.99 0.78 3.85 18.65 0.53 3.65 18.10 0.65 RetinexNet 4.47 30.83 0.75 4.60 26.42 0.52 4.41 21.90 0.97 Zero-DCE 3.56 25.52 0.82 3.77 21.10 0.73 3.28 19.83 1.22 Restormer 5.15 37.56 0.16 5.59 37.93 0.31 4.38 33.81 0.48 This invention 2.96 25.49 0.771 3.76 22.47 0.82 0.82 2.76 0.76 As can be seen from the results in the table, the method disclosed in this invention is significantly better than the comparative methods in terms of NIQE, BRISQUE, and UNIQUE metrics on the DICM, LIME, and MEF datasets.

[0058] Therefore, the method disclosed in this invention can simultaneously improve the objective perceived quality and subjective visual effect of low-light images, and is superior to other methods in terms of brightness balance, detail fidelity and color naturalness.

[0059] This application also provides a low-light image enhancement device that combines adaptive gamma learning with an attention network, such as... Figure 6 As shown, the device includes: The gamma correction image determination unit 601 is used to extract features from the low-light image that needs to be enhanced, perform global context fusion on the extracted features to obtain context enhancement features, and then obtain the adaptive gamma correction image of the low-light image through the context enhancement features. The first enhancement unit 602 is used to adjust the brightness of the low-light image using the adaptive gamma correction map to obtain a preliminary enhanced image with global brightness balance. The second enhancement unit 603 is used to optimize the details and colors of the preliminary enhanced image through an attention-enhanced encoder-decoder network to obtain a target enhanced image, and then to perform loss optimization on the target enhanced image through a multi-loss function determined based on several loss functions to obtain a final enhanced image. The several loss functions include an L1 reconstruction loss function to ensure pixel-level accuracy, an SSIM loss function to maintain structural similarity, a TV loss function to promote spatial smoothness, a color constancy loss function to suppress color distortion, and a gamma regularization loss function to stabilize gamma values.

[0060] In another embodiment, feature extraction of the low-light image requiring enhancement in the gamma correction map determination unit includes: Feature extraction is performed using a three-level 3×3 convolutional layer, with the following formula: in, For the low-light image, The extracted local texture features are shown, where H and W represent the height and width of the image, respectively. This represents a 3×3 convolution operation, BN represents batch normalization, and ReLU represents the activation function. ; The step of performing global context fusion on the extracted features to obtain context-enhanced features includes: Adaptive average pooling is performed on the extracted features to obtain the global brightness descriptor. ; The global brightness descriptor G is processed by two levels of 1×1 convolution to obtain channel attention weights. Then, the channel attention weights are multiplied point by point with the extracted features to obtain the context-enhanced features.

[0061] In another embodiment, adjusting the brightness of the low-light image using the adaptive gamma correction map in the first enhancement unit includes: Through formula An adaptive gamma correction map is used to adjust the brightness of the low-light image, where ε = 10^{-6}. The adaptive gamma correction diagram is shown below. This is the initial enhanced image.

[0062] In another embodiment, determining the multiple loss function through several loss functions in the second enhancement unit includes: The preliminary enhanced image and the preset normal light image are used as input parameters for the L1 reconstruction loss function, SSIM loss function, TV loss function, color constancy loss function and gamma regularization loss function to obtain the loss of the preliminary enhanced image; The target enhanced image and the preset normal light image are used as input parameters for the L1 reconstruction loss function, SSIM loss function, TV loss function, color constancy loss function and gamma regularization loss function to obtain the loss of the target enhanced image; The multiple loss function is determined based on the loss of the initial enhanced image and the loss of the target enhanced image.

[0063] The above embodiments of the present invention provide a low-light image enhancement method combining adaptive gamma learning and attention network, and based on the method, a low-light image enhancement device combining adaptive gamma learning and attention network is provided. The quality of the enhanced low-light image can be improved by the above method and device.

[0064] This embodiment also discloses a computer device, such as... Figure 6 As shown, the computer device includes a processor and a memory, the memory storing at least one instruction, which is loaded and executed by the processor to implement any of the above-described low-light image enhancement methods combining adaptive gamma learning and attention networks.

[0065] Furthermore, in the above-described embodiment of the low-light image enhancement device combining adaptive gamma learning and attention networks, the logical division of each program module is merely illustrative. In practical applications, the above functions can be assigned to different program modules as needed, for example, for the sake of corresponding hardware configuration requirements or software implementation convenience. That is, the internal structure of the low-light image enhancement device combining adaptive gamma learning and attention networks can be divided into different program modules to complete all or part of the functions described above.

[0066] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A low-light image enhancement method combining adaptive gamma learning and attention networks, characterized in that, The method includes: Feature extraction is performed on the low-light image that needs to be enhanced. Global context fusion is then performed on the extracted features to obtain context-enhanced features. The adaptive gamma correction map of the low-light image is then obtained through the context-enhanced features. The low-light image is brightness adjusted using the adaptive gamma correction map to obtain a preliminary enhanced image with global brightness balance. The initial enhanced image is optimized for detail and color using an attention-enhanced encoder-decoder network to obtain a target enhanced image. Then, the target enhanced image is optimized for loss using a multi-loss function determined by several loss functions to obtain the final enhanced image. The several loss functions include an L1 reconstruction loss function to ensure pixel-level accuracy, an SSIM loss function to maintain structural similarity, a TV loss function to promote spatial smoothness, a color constancy loss function to suppress color distortion, and a gamma regularization loss function to stabilize gamma values.

2. The method according to claim 1, characterized in that, The feature extraction for the low-light image that needs enhancement includes: Feature extraction is performed using a three-level 3×3 convolutional layer, with the following formula: in, For the low-light image, The extracted local texture features are shown, where H and W represent the height and width of the image, respectively. This represents a 3×3 convolution operation, BN represents batch normalization, and ReLU represents the activation function. .

3. The method according to claim 1, characterized in that, The step of performing global context fusion on the extracted features to obtain context-enhanced features includes: Adaptive average pooling is performed on the extracted features to obtain the global brightness descriptor. ; The global brightness descriptor G is processed by two levels of 1×1 convolution to obtain channel attention weights. Then, the channel attention weights are multiplied point by point with the extracted features to obtain the context-enhanced features.

4. The method according to claim 1, characterized in that, The step of adjusting the brightness of the low-light image using the adaptive gamma correction map includes: Through formula An adaptive gamma correction map is used to adjust the brightness of the low-light image, where ε = 10^{-6}. The adaptive gamma correction diagram is shown below. This is the initial enhanced image.

5. The method according to claim 1, characterized in that, The step of optimizing the details and colors of the initially enhanced image using an attention-enhanced encoder-decoder network includes: Determine the average channel feature extracted by global average pooling and the maximum channel feature extracted by global max pooling, and determine the channel weights using the average channel feature and the maximum channel feature; Spatial weights are determined based on the channel weights, attention enhancement features are then determined based on the spatial weights, and finally, an enhanced image for detail and color optimization is determined based on the attention enhancement features.

6. The method according to claim 1, characterized in that, The loss optimization of the target enhancement image by using multiple loss functions determined based on several loss functions includes: The preliminary enhanced image and the preset normal light image are used as input parameters for the L1 reconstruction loss function, SSIM loss function, TV loss function, color constancy loss function and gamma regularization loss function to obtain the loss of the preliminary enhanced image; The target enhanced image and the preset normal light image are used as input parameters for the L1 reconstruction loss function, SSIM loss function, TV loss function, color constancy loss function and gamma regularization loss function to obtain the loss of the target enhanced image; The total loss is determined based on the loss of the initial enhanced image and the loss of the target enhanced image, and then the target enhanced image is optimized using the total loss.

7. A low-light image enhancement device combining adaptive gamma learning and attention networks, characterized in that, The device includes: The gamma correction image determination unit is used to extract features from the low-light image that needs to be enhanced, perform global context fusion on the extracted features to obtain context enhancement features, and then obtain the adaptive gamma correction image of the low-light image through the context enhancement features. The first enhancement unit is used to adjust the brightness of the low-light image using the adaptive gamma correction map to obtain a preliminary enhanced image with global brightness balance. The second enhancement unit is used to optimize the details and colors of the preliminary enhanced image through an attention-enhanced encoder-decoder network to obtain a target enhanced image. Then, the target enhanced image is optimized for loss through a multi-loss function determined based on several loss functions to obtain a final enhanced image. The several loss functions include an L1 reconstruction loss function to ensure pixel-level accuracy, an SSIM loss function to maintain structural similarity, a TV loss function to promote spatial smoothness, a color constancy loss function to suppress color distortion, and a gamma regularization loss function to stabilize gamma values.

8. The apparatus according to claim 7, characterized in that, The feature extraction of the low-light image requiring enhancement in the gamma correction image determination unit includes: Feature extraction is performed using a three-level 3×3 convolutional layer, with the following formula: in, For the low-light image, The extracted local texture features are shown, where H and W represent the height and width of the image, respectively. This represents a 3×3 convolution operation, BN represents batch normalization, and ReLU represents the activation function. ; The step of performing global context fusion on the extracted features to obtain context-enhanced features includes: Adaptive average pooling is performed on the extracted features to obtain the global brightness descriptor. ; The global brightness descriptor G is processed by two levels of 1×1 convolution to obtain channel attention weights. Then, the channel attention weights are multiplied point by point with the extracted features to obtain the context-enhanced features.

9. The method according to claim 1, characterized in that, The brightness adjustment of the low-light image using the adaptive gamma correction map in the first enhancement unit includes: Through formula An adaptive gamma correction map is used to adjust the brightness of the low-light image, where ε = 10^{-6}. The adaptive gamma correction diagram is shown below. This is the initial enhanced image.

10. The apparatus according to claim 7, characterized in that, The loss optimization of the target enhanced image by using a multi-loss function determined based on several loss functions in the second enhancement unit includes: The preliminary enhanced image and the preset normal light image are used as input parameters for the L1 reconstruction loss function, SSIM loss function, TV loss function, color constancy loss function and gamma regularization loss function to obtain the loss of the preliminary enhanced image; The target enhanced image and the preset normal light image are used as input parameters for the L1 reconstruction loss function, SSIM loss function, TV loss function, color constancy loss function and gamma regularization loss function to obtain the loss of the target enhanced image; The total loss is determined based on the loss of the initial enhanced image and the loss of the target enhanced image, and then the target enhanced image is optimized using the total loss.