Low-light image enhancement method and apparatus based on trainable HSL color gamut distribution

By converting low-light RGB images to the HSL color gamut and using a fused cross-attention U-Net model, combined with multiple loss functions to train a deep learning model, the problems of color gamut conversion applicability and computational complexity in low-light image enhancement are solved, achieving efficient image enhancement results.

CN119090729BActive Publication Date: 2025-11-14ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411166205.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2025-11-14
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

Existing technologies suffer from insufficient applicability of color gamut conversion, inadequate model generalization ability, and high computational complexity in low-light image enhancement, resulting in poor image enhancement effects and excessive resource consumption.

Method used

We employ a method based on trainable HSL color gamut distribution to convert low-light RGB images into the HSL color gamut. This conversion is then processed using a cross-attention U-Net model that integrates a brightness enhancement module and a color denoising module. We also construct target color gamut loss and RGB color gamut loss for training and optimize the conversion function to achieve efficient low-light image enhancement.

Benefits of technology

It improves the applicability and stability of low-light image enhancement, reduces computational complexity, and achieves high-quality image enhancement results in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090729B_ABST
    Figure CN119090729B_ABST
Patent Text Reader

Abstract

This invention discloses a low-light image enhancement method and apparatus based on a trainable HSL color gamut distribution, comprising: converting a low-light RGB image to the HSL color gamut and then adjusting the data distribution using a transformation function to obtain a target color gamut data distribution; inputting the target color gamut data distribution into the brightness enhancement module and color denoising module of a deep learning model respectively, and fusing them to output an enhanced target color gamut image; performing an inverse color gamut transformation on the enhanced target color gamut image to obtain an enhanced RGB image; constructing a target color gamut loss and an RGB color gamut loss to train a deep learning model and optimizing the transformation function; and based on the optimized transformation function, performing a color gamut transformation on a new low-light RGB image to the target color gamut, inputting it into the trained deep learning model, and then performing an inverse color gamut transformation to obtain the enhanced RGB image. This invention, based on a trainable HSL color gamut data distribution, can significantly improve the low-light image enhancement effect while reducing the computational complexity of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically relating to a low-light image enhancement method and apparatus based on a trainable HSL color gamut distribution. Background Technology

[0002] In the field of digital image processing, low-light image enhancement is an important technique aimed at improving the visibility and quality of images taken under insufficient lighting conditions. Low-light conditions often lead to problems such as increased noise, reduced contrast, and loss of detail in images, which are particularly prominent in applications such as security monitoring, night driving assistance systems, and smartphone photography.

[0003] Traditional image enhancement techniques, such as histogram equalization and gamma correction, while improving image brightness and contrast, often come with side effects such as over-enhancement and noise amplification. Furthermore, these methods typically address global image properties, neglecting local details and the complexity of scene content, resulting in insufficient preservation of image details.

[0004] With the development of deep learning technology, low-light image enhancement methods based on deep learning have become a research hotspot. These methods, by learning from large amounts of image data, can automatically extract and utilize high-level features of images, thereby achieving more refined and natural image enhancement effects. Deep learning models can not only directly generate enhanced images from original low-light images through end-to-end training, but also integrate multiple loss functions during model training to optimize pixel-level and semantic-level information of images, further improving the quality of enhanced images.

[0005] Deep learning employs various color gamut processing schemes to enhance low-light enhancement capabilities. Beyond the basic RGB color gamut approach, numerous other methods exist, such as: altering the RGB color gamut distribution model; decomposing the observed image into a dot product of the sharp image and illumination intensity based on Retinex theory; extracting pixel luminance signals based on the YUV color gamut; and extracting hue, saturation, and brightness based on the HSV color gamut. All these methods demonstrate that for low-light enhancement tasks, converting to an appropriate color gamut to improve data distribution quality plays a crucial role in improving model performance.

[0006] Furthermore, to address the potential overfitting and insufficient generalization capabilities of deep learning models in practical applications, researchers have explored various regularization and optimization strategies, such as data augmentation, network architecture innovation, and complexity control. These strategies help improve the stability and adaptability of the models, enabling them to exhibit good enhancement effects under different lighting conditions and scenarios. At the same time, deep learning models typically require substantial computational resources to support their complex network structures and training processes, which to some extent limits their application on resource-constrained devices.

[0007] Therefore, for low-light image enhancement tasks, how to select appropriate color gamut conversion methods according to specific task requirements and effectively integrate image information from different color gamuts, how to design more efficient and stable regularization methods and optimization algorithms to further improve the performance and stability of the model, and how to reduce the computational complexity of the model while ensuring the enhancement effect have become important research directions. Summary of the Invention

[0008] In view of the above, the purpose of this invention is to provide a low-light image enhancement method and apparatus based on a trainable HSL color gamut distribution. By adjusting the data distribution based on the HSL color gamut, while separating brightness information, the continuously distributed hue and saturation information can provide excellent gradient information. The proposed trainable HSL color gamut data distribution can compact the dark and bright parts of the HSL color gamut for low-light enhancement tasks, better meeting the requirements of these tasks. By inputting the trainable HSL color gamut data distribution into a deep learning model, and using a U-Net with a cross-attention mechanism for data processing on the adjusted color and brightness channels, a high-quality low-light image enhancement scheme with low computational complexity is provided in this field. This scheme can well meet the data distribution requirements of low-light enhancement tasks. Furthermore, since the trainable HSL color gamut data distribution provides a trainable parameter, namely the compaction index, it can be adaptively adjusted for different models and application scenarios to achieve optimal results.

[0009] To achieve the above-mentioned objectives, the present invention provides the following technical solution:

[0010] In a first aspect, the present invention provides a low-light image enhancement method based on a trainable HSL color gamut distribution, comprising the following steps:

[0011] The RGB color gamut data distribution of a low-light RGB image is converted into an HSL color gamut data distribution, and the HSL color gamut data distribution is adjusted based on a transformation function to obtain the target color gamut data distribution.

[0012] The target color gamut data distribution is input into the brightness enhancement module and color noise reduction module of the deep learning model respectively. The results of the two modules are then fused to output the enhanced target color gamut image. The enhanced target color gamut image is then subjected to inverse color gamut transformation to finally obtain the enhanced RGB image.

[0013] The bright RGB image corresponding to the low-light RGB image is used as the second label, and the target color gamut image after adjusting the data distribution of the bright RGB image is used as the first label. The target color gamut loss is constructed based on the first label and the enhanced target color gamut image, and the RGB color gamut loss is constructed based on the second label and the enhanced RGB image. The deep learning model is trained based on the target color gamut loss and the RGB color gamut loss and the transformation function is optimized at the same time. That is, the HSL color gamut data distribution is adjusted through training.

[0014] The optimized transformation function is used to transform the RGB color gamut of the new low-light RGB image to the target color gamut. The image is then input into the trained deep learning model for inference. The inference result is then subjected to inverse color gamut transformation to ultimately achieve low-light image enhancement.

[0015] Preferably, the step of adjusting the HSL color gamut data distribution based on a transformation function to obtain the target color gamut data distribution includes:

[0016] The target color gamut data distribution is obtained by adjusting the data distribution of the vector HSL=(H,S,L) of HSL color gamut data distribution using a transformation function, where H is hue, S is saturation, and L is brightness. The transformation function formula is as follows:

[0017] XYZ=f(H,S,L)

[0018] Where XYZ are the new three-dimensional coordinates that map the HSL color gamut data distribution to the target color gamut data distribution, and f(·) is the transformation function;

[0019] The specific calculation steps for the transformation function f(·) are as follows:

[0020] θ = clamp(L - 0.5, -0.5, 0.5)

[0021] Where θ is the adjusted hue value, and clamp(·) is the numerical constraint function;

[0022] color_sensitive=(cos(θ·π)+ε) k

[0023] Where color_sensitive is the color sensitivity, ε is a small constant, k is the compactness exponent, and k is the parameter to be optimized in the conversion function;

[0024] c x =cos(2πH)

[0025] c y =sin(2πH)

[0026] Among them, c x c is the cosine value of the hue. y Let be the sine value of the hue, cos(·) be the cosine function, and sin(·) be the sine function;

[0027] X = color_sensitive·S·c x

[0028] Y = color_sensitive·S·c y

[0029] Z = L

[0030] Where X, Y, and Z are three coordinate values ​​in the new three-dimensional coordinates of the target color gamut data distribution, with X and Y representing color and Z representing brightness.

[0031] Preferably, the step of inputting the target color gamut data distribution into the brightness enhancement module and the color noise reduction module of the deep learning model respectively, and then fusing the results of the two modules to output an enhanced target color gamut image, includes:

[0032] Both the brightness enhancement module and the color denoising module of the deep learning model use U-Net with a fusion cross-attention mechanism for data processing. The brightness enhancement module enhances the brightness of the target color gamut data distribution, and the color denoising module denoises the target color gamut data distribution. Finally, the outputs of the brightness enhancement module and the color denoising module are fused to obtain the enhanced target color gamut image.

[0033] Preferably, both the brightness enhancement module and the color denoising module of the deep learning model use U-Net with a fused cross-attention mechanism for data processing, including:

[0034] In the brightness enhancement path of the deep learning model's data processing, the brightness enhancement module includes a first encoder, a first integrated cross-attention module, a second encoder, a second integrated cross-attention module, a third integrated cross-attention module, a first decoder, a fourth integrated cross-attention module, and a second decoder connected in sequence, with a first skip connection established between the first integrated cross-attention module and the fourth integrated cross-attention module. In the color denoising path of the deep learning model's data processing, the color denoising module includes a third encoder, a first integrated cross-attention module, a fourth encoder, a second integrated cross-attention module, a third integrated cross-attention module, a third decoder, a fourth integrated cross-attention module, and a fourth decoder connected in sequence, with a second skip connection established between the first integrated cross-attention module and the fourth integrated cross-attention module. By inputting the target color gamut data distribution into the first encoder and the third encoder respectively, and then passing it through the brightness enhancement path and the color denoising path respectively, the outputs of the second decoder and the fourth decoder are obtained respectively. The outputs of the second decoder and the fourth decoder are fused to obtain an enhanced target color gamut image.

[0035] Each integrated cross-attention module includes a luminance cross-attention module and a color cross-attention module. The luminance cross-attention module obtains a query Q based on the intermediate input of the luminance enhancement path and a key K and a value V based on the input of the color denoising path. It then calculates the intermediate output of the luminance enhancement path through cross-attention. The color cross-attention module obtains a key K and a value V based on the intermediate input of the luminance enhancement path and a query Q based on the input of the color denoising path. It then calculates the intermediate output of the color denoising path through cross-attention. The intermediate inputs here correspond to the previous encoder, integrated cross-attention module, or decoder adjacent to the current integrated cross-attention module. The intermediate outputs here correspond to the next encoder, integrated cross-attention module, or decoder adjacent to the current integrated cross-attention module.

[0036] Preferably, both the RGB color gamut loss and the target color gamut loss include: Charbonnier loss, structural similarity loss, edge loss, and perceptual loss.

[0037] Preferably, the color gamut conversion, model inference, and inverse color gamut transformation of multiple images are divided into three threads, and the color gamut conversion, model inference, and inverse color gamut transformation of multiple images are respectively implemented in parallel through the three threads.

[0038] Secondly, in order to achieve the above-mentioned objectives, the present invention also provides a low-light image enhancement device based on a trainable HSL color gamut distribution, comprising: a color gamut data distribution adjustment module, a deep learning model construction module, a model training and parameter optimization module, and a low-light image enhancement module.

[0039] The color gamut data distribution adjustment module is used to convert the RGB color gamut data distribution of a low-light RGB image into an HSL color gamut data distribution, and to adjust the HSL color gamut data distribution based on a conversion function to obtain the target color gamut data distribution.

[0040] The deep learning model building module is used to input the target color gamut data distribution into the brightness enhancement module and the color noise reduction module of the deep learning model respectively, and then merge the results of the two modules to output the enhanced target color gamut image. The enhanced target color gamut image is then subjected to inverse color gamut transformation to finally obtain the enhanced RGB image.

[0041] The model training and parameter optimization module is used to take the bright RGB image corresponding to the low-light RGB image as the second label, and the target color gamut image after adjusting the data distribution of the bright RGB image as the first label. Based on the first label and the enhanced target color gamut image, a target color gamut loss is constructed. Based on the second label and the enhanced RGB image, an RGB color gamut loss is constructed. Based on the target color gamut loss and the RGB color gamut loss, a deep learning model is trained and the transformation function is optimized at the same time. That is, the HSL color gamut data distribution is adjusted through training.

[0042] The low-light image enhancement module is used to convert the RGB color gamut of the new low-light RGB image to the target color gamut based on the optimized transformation function, and then input it into the trained deep learning model for inference. The inference result is then subjected to inverse color gamut transformation to finally achieve low-light image enhancement.

[0043] Thirdly, to achieve the above-mentioned objectives, embodiments of the present invention also provide a low-light image enhancement device based on a trainable HSL color gamut distribution, including a memory and one or more processors, wherein the memory is used to store a computer program, and the processor is used to implement the above-mentioned low-light image enhancement method based on a trainable HSL color gamut distribution when the computer program is executed.

[0044] Fourthly, to achieve the above-mentioned objectives, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a computer, implements the above-mentioned low-light image enhancement method based on trainable HSL color gamut distribution.

[0045] Fifthly, to achieve the above-mentioned objectives, embodiments of the present invention also provide a computer product comprising a computer program that, when executed by a processor, implements the above-mentioned low-light image enhancement method based on trainable HSL color gamut distribution.

[0046] Compared with the prior art, the beneficial effects of the present invention include at least the following:

[0047] (1) This invention designs a trainable HSL color gamut data distribution for low-light image enhancement tasks, and provides a trainable compactness index, so that the data in both dark and bright areas can be more compact, and the gradient information is more in line with the requirements of low-light image enhancement tasks. Since low-light enhancement tasks face a variety of application scenarios, the data distribution parameters of the trainable HSL color gamut data distribution are optimized through training, providing stronger applicability to different scenarios and showing excellent results in different application scenarios.

[0048] (2) This invention constructs a deep learning model that includes a brightness enhancement module and a color noise reduction module. By processing image information through two separate paths, it can learn multi-level semantic information well and achieve pixel-level and semantic-level optimization. This significantly improves the low-light image enhancement effect of the deep learning model in the trainable HSL color gamut space. Furthermore, based on the U-Net fusion cross-attention mechanism, it achieves high-quality image enhancement in low computational complexity scenarios.

[0049] (3) This invention optimizes the training and data distribution parameters of a deep learning model by constructing a model that includes target color gamut loss and RGB color gamut loss, and uses the fusion operation based on multiple losses as a guide to further improve the performance and stability of the model. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is a flowchart illustrating the low-light image enhancement method based on trainable HSL color gamut distribution provided in an embodiment of the present invention.

[0052] Figure 2 This is a mathematical curve visualization diagram of the target color gamut data distribution (compactness index k = 0.2) provided in an embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram of the integrated cross-attention module in the deep learning model provided in this embodiment of the invention;

[0054] Figure 4 The following is a comparison of the effects of the low-light RGB image in the input LOL_v1 dataset, the enhanced RGB image output by the model inference, and GroundTruth in the RGB space and the target color space, respectively, provided in this embodiment of the invention.

[0055] Figure 5 This is a schematic diagram of the low-light image enhancement device based on trainable HSL color gamut distribution provided in an embodiment of the present invention. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the scope of protection of this invention.

[0057] The inventive concept of this invention is as follows: Addressing the shortcomings of existing deep learning-based low-light image enhancement methods, such as insufficient applicability of color gamut conversion, inadequate model generalization ability, and high computational complexity, this invention provides a low-light image enhancement method and apparatus based on a trainable HSL color gamut distribution. It proposes optimizing the data distribution parameters of the trainable HSL color gamut distribution and extracting multi-level features including brightness and color by constructing a deep learning model based on U-Net and cross-attention mechanisms. By constructing a fusion loss function to train the deep learning model and simultaneously optimizing the data distribution parameters, the applicability of the color gamut conversion method for low-light image enhancement tasks is improved, further enhancing the model's performance and stability, and reducing computational complexity while ensuring enhancement effects.

[0058] Figure 1 This is a flowchart illustrating the low-light image enhancement method based on trainable HSL color gamut distribution provided in an embodiment of the present invention. Figure 1 As shown, the embodiment provides a low-light image enhancement method based on a trainable HSL color gamut distribution, including the following steps:

[0059] S1 converts the RGB color gamut data distribution of the low-light RGB image into the HSL color gamut data distribution, and adjusts the HSL color gamut data distribution based on the transformation function to obtain the target color gamut data distribution.

[0060] In this embodiment, the RGB color gamut data distribution of the low-light RGB image is first converted to the HSL color gamut data distribution. Then, the vector HSL = (H, S, L) of the HSL color gamut data distribution is adjusted using a transformation function to obtain the target color gamut data distribution, where H is hue, S is saturation, and L is lightness. The transformation function formula is as follows:

[0061] XYZ=f(H,S,L)

[0062] Where XYZ represents the new three-dimensional coordinates corresponding to HSL that map the HSL color gamut data distribution to the target color gamut data distribution, and f(·) is the transformation function.

[0063] The specific calculation steps for the transformation function f(·) are as follows:

[0064] (1) Adjust the hue value:

[0065] θ = clamp(L - 0.5, -0.5, 0.5)

[0066] Where θ is the adjusted hue value, and clamp(·) is the numerical constraint function.

[0067] (2) Calculate color sensitivity:

[0068] color_sensitive=(cos(θ·π)+ε) k

[0069] Where color_sensitive is the color sensitivity, ε is a small constant used to prevent numerical instability issues caused by a denominator of 0 or a value within the square root, and k is the compaction exponent, which is the parameter to be optimized in the transformation function.

[0070] (3) Calculate the cosine and sine values ​​of the hue:

[0071] c x =cos(2πH)

[0072] c y =sin(2πH)

[0073] Among them, c x c is the cosine value of the hue. y is the sine value of the hue, cos(·) is the cosine function, and sin(·) is the sine function.

[0074] (4) Transform coordinates to the target color space:

[0075] X = color_sensitive·S·c x

[0076] Y = color_sensitive·S·c y

[0077] Z = L

[0078] Where X, Y, and Z are three coordinate values ​​in the new three-dimensional coordinates of the target color gamut data distribution, with X and Y representing color and Z representing brightness.

[0079] A visualization of the mathematical curves for a specific type of target color gamut data distribution (compactness index k = 0.2) is shown below. Figure 2 As shown, it can be figuratively described as the distribution of target color gamut data for low-light image enhancement resembling a rugby ball in three-dimensional space. The positions with brightness close to 1 and close to 0 are more compact, while the parts with brightness close to 0.5 have the richest colors and are the areas most significantly affected by saturation.

[0080] The trainable features are reflected in the compactness index k in the color sensitivity calculation in step (2). By combining the training of the deep learning model, the most suitable compactness index k in a specific application scenario and a specific model network structure can be calculated, thereby improving the applicability of the data distribution.

[0081] S2, the target color gamut data distribution is input into the brightness enhancement module and color noise reduction module of the deep learning model respectively, and the results of the two modules are fused to output the enhanced target color gamut image. The enhanced target color gamut image is then subjected to inverse color gamut transformation to finally obtain the enhanced RGB image.

[0082] In this embodiment, after converting the RGB color gamut data distribution of a low-light RGB image to an HSL color gamut data distribution, it is input into a deep learning model for data augmentation through a brightness enhancement route and a color denoising route. In the deep learning model, brightness enhancement and color denoising modules are designed for the two routes respectively. Both modules use U-Net with a fused cross-attention mechanism for data processing. The brightness enhancement module enhances the target color gamut data distribution, and the color denoising module denoises the target color gamut data distribution. Finally, the outputs of the brightness enhancement and color denoising modules are fused to obtain the enhanced target color gamut image. Both routes possess the ability to perform both brightness enhancement and color denoising, enabling them to effectively learn multi-level semantic information. Combined with a suitable target color gamut data distribution model, they can effectively handle the task of low-light image enhancement and improve the low-light image enhancement effect.

[0083] like Figure 1As shown, in the brightness enhancement path, the brightness enhancement module includes a first encoder, a first integrated cross-attention module, a second encoder, a second integrated cross-attention module, a third integrated cross-attention module, a first decoder, a fourth integrated cross-attention module, and a second decoder connected in sequence, and a first jump connection is established between the first integrated cross-attention module and the fourth integrated cross-attention module; in the color denoising path, the color denoising module includes a third encoder, a first integrated cross-attention module, a fourth encoder, a second integrated cross-attention module, a third integrated cross-attention module, a third decoder, a fourth integrated cross-attention module, and a fourth decoder connected in sequence, and a second jump connection is established between the first integrated cross-attention module and the fourth integrated cross-attention module; by inputting the target color gamut data distribution into the first encoder and the third encoder respectively, and then passing it through the brightness enhancement path and the color denoising path respectively, the outputs of the second decoder and the fourth decoder are obtained respectively, and the outputs of the second decoder and the fourth decoder are fused to obtain the enhanced target color gamut image.

[0084] like Figure 3 As shown, each integrated cross-attention module includes a luminance cross-attention module and a color cross-attention module. The luminance cross-attention module obtains the query Q based on the intermediate input of the luminance enhancement path and the key K and value V based on the input of the color denoising path. It then calculates the intermediate output of the luminance enhancement path through cross-attention. The color cross-attention module obtains the key K and value V based on the intermediate input of the luminance enhancement path and the query Q based on the input of the color denoising path. It then calculates the intermediate output of the color denoising path through cross-attention. The intermediate inputs here correspond to the previous encoder, integrated cross-attention module, or decoder adjacent to the current integrated cross-attention module, and the intermediate outputs here correspond to the next encoder, integrated cross-attention module, or decoder adjacent to the current integrated cross-attention module.

[0085] S3, take the bright RGB image corresponding to the low-light RGB image as the second label, and take the target color gamut image after adjusting the data distribution of the bright RGB image as the first label. Construct the target color gamut loss based on the first label and the enhanced target color gamut image, construct the RGB color gamut loss based on the second label and the enhanced RGB image, train the deep learning model based on the target color gamut loss and the RGB color gamut loss and optimize the transformation function at the same time, that is, adjust the HSL color gamut data distribution through training.

[0086] In this embodiment, a composite loss is used to guide training. The bright RGB image corresponding to the low-light RGB image is used as the second label, and the target color gamut image after data distribution adjustment of the bright RGB image is used as the first label. A target color gamut loss is constructed based on the first label and the enhanced target color gamut image, and an RGB color gamut loss is constructed based on the second label and the enhanced RGB image.

[0087] The target color gamut loss and the RGB color gamut loss are each guided by a combination of four loss functions: Charbonnier loss, structural similarity loss, edge loss, and perceptual loss.

[0088] (1) Charbonnier loss:

[0089] Charbonnier loss is a smoothed version of L1 loss, providing robust pixel-level features for regression tasks in image processing. Its formula is:

[0090]

[0091] Among them, L charb (x,y) represents the Charbonnier loss, x i and y i Let be the model prediction value and the true label of the i-th pixel, respectively; V be the set of pixels; |V| be the number of pixels; and ∈ be a small constant used to prevent numerical stability problems caused by a denominator of 0 or a value within the square root.

[0092] (2) Structural similarity loss:

[0093] Structural similarity is a metric used to measure the similarity between two images. It is used to evaluate image quality and measures the overall structural similarity between the two images, revealing their structural features. Structural similarity loss is a loss function designed based on structural similarity metric, used to optimize the model during training so that the generated images are more structurally similar to the target images. Its formula is:

[0094]

[0095] L SSIM (x,y)=1-SSIM(x,y)

[0096] Where SSIM(x,y) is the structural similarity index, L SSIM (x,y) represents the structural similarity loss, μ x and μ y These are the means of the x and y values ​​of the image, respectively. and The variances of the images x and y are σ, respectively. xyLet x be the covariance of x and y, and c1 and c2 be small constants used to maintain stability to avoid the denominator being zero.

[0097] (3) Edge Loss:

[0098] Edge loss is used to enhance the edge information of an image. Based on Gaussian filtering and the Laplacian operator, it can provide additional attention to high-frequency information such as edges while maintaining the overall image similarity. Its formula is:

[0099] L edge (x,y)=MSE(Laplacian(x),Laplacian(y))

[0100] Among them, L edge (x,y) represents the edge loss, MSE(·) represents the mean square error function, and Laplacian(x) and Laplacian(y) represent the results obtained by applying the Laplacian operator after Gaussian filtering.

[0101] (4) Perceptual Loss:

[0102] Perceptual loss is used to compare the differences between two images in high-level features. Features extracted based on pre-trained deep networks (such as VGG networks) are more consistent with human visual perception of images and can extract semantic information for multi-level comparison, thus effectively evaluating image similarity. Its formula is:

[0103]

[0104] Among them, L perceptual (x,y) represents the perceptual loss, F j (x) and F j (y) represents the features extracted from the j-th layer of a pre-trained deep network, w j is the weight of the j-th layer, and Criterion(·) is the standard used to calculate the loss, such as L1, L2 or MSE. These loss functions are widely used in deep learning for tasks such as image restoration, super-resolution and style transfer. By combining these losses, the model can be better optimized to achieve specific visual effects.

[0105] During the training of deep learning models, the learning rate is adjusted by combining periodic cosine annealing restart and progressive warm-up strategies. At the same time, random pruning and reversal strategies for training data are introduced to enhance data strength and avoid continuous oscillation or overfitting.

[0106] S4, based on the optimized transformation function, transforms the RGB color gamut of the new low-light RGB image to the target color gamut and inputs it into the trained deep learning model for inference. The inference result is then subjected to inverse color gamut transformation to finally achieve low-light image enhancement.

[0107] In this embodiment, for a new low-light RGB image to be enhanced, it is first converted from the RGB color gamut to the target color gamut using an optimized conversion function. Then, it is input into a trained deep learning model for model inference. The target color gamut image output by the model is subjected to an inverse color gamut transformation to obtain an enhanced RGB color gamut image, thereby achieving low-light image enhancement.

[0108] In this embodiment, by dividing color gamut conversion, model inference, and inverse color gamut transformation into three threads, the color gamut conversion, model inference, and inverse color gamut transformation processes of multiple images can be implemented in parallel through task queues or other means, which can further improve the running efficiency.

[0109] like Figure 4 The image shown is an input low-light RGB image in RGB space. Figure 4 (a) in the model inference output enhanced RGB image ( Figure 4 (b) and Ground Truth Figure 4 The effect comparison in (c) and the input low-light RGB image in the target color space ( Figure 4 (d) in the model inference output enhanced RGB image ( Figure 4 (e) and Ground Truth Figure 4 The comparison diagram of (f) shows that the embodiments of the present invention can successfully achieve multi-scale semantic analysis in the constructed color gamut space, thereby achieving the effect of high-quality low-light image enhancement.

[0110] In summary, this invention provides a low-light image enhancement method based on a trainable HSL color gamut distribution. It proposes a trainable HSL color gamut data distribution to optimize the distribution of input data, enabling better gradients for the low-light image data distribution information during model training, thereby improving the low-light image enhancement performance of the deep learning model. Furthermore, existing low-light image enhancement algorithms have demonstrated the significant impact of a good color gamut distribution. The trainable HSL color gamut data distribution in this invention provides trainable data distribution parameters, automatically adapting to various application scenarios and different inference network structures. Once the optimal data distribution parameters are obtained, they can be extracted and used in conjunction with the model inference process. The trainable HSL color gamut distribution can be ported to different network models, and the distribution model can be extracted separately after training for preprocessing, thus allowing for simple and convenient integration with existing low-light image enhancement methods. This invention also employs a U-Net deep learning model with a fused cross-attention mechanism, achieving a significant improvement in low-light image enhancement performance while reducing model computational complexity.

[0111] Based on the same inventive concept, such as Figure 5 As shown, this embodiment of the invention also provides a low-light image enhancement device 500 based on a trainable HSL color gamut distribution, including: a color gamut data distribution adjustment module 510, a deep learning model construction module 520, a model training and parameter optimization module 530, and a low-light image enhancement module 540.

[0112] The color gamut data distribution adjustment module 510 is used to convert the RGB color gamut data distribution of a low-light RGB image into an HSL color gamut data distribution, and to adjust the HSL color gamut data distribution based on a conversion function to obtain the target color gamut data distribution.

[0113] The deep learning model building module 520 is used to input the target color gamut data distribution into the brightness enhancement module and color noise reduction module of the deep learning model respectively, and then output the enhanced target color gamut image after fusing the results of the two modules. Finally, the enhanced RGB image is obtained by performing an inverse color gamut transformation on the enhanced target color gamut image.

[0114] The model training and parameter optimization module 530 is used to take the bright RGB image corresponding to the low-light RGB image as the second label, and the target color gamut image after adjusting the data distribution of the bright RGB image as the first label. Based on the first label and the enhanced target color gamut image, a target color gamut loss is constructed. Based on the second label and the enhanced RGB image, an RGB color gamut loss is constructed. Based on the target color gamut loss and the RGB color gamut loss, a deep learning model is trained and the transformation function is optimized at the same time. That is, the HSL color gamut data distribution is adjusted through training.

[0115] The low-light image enhancement module 540 is used to convert the RGB color gamut of the new low-light RGB image to the target color gamut based on the optimized transformation function, and then input it into the trained deep learning model for inference. The inference result is then subjected to inverse color gamut transformation to finally achieve low-light image enhancement.

[0116] Based on the same inventive concept, this invention also provides a low-light image enhancement device based on a trainable HSL color gamut distribution, including a memory and one or more processors. The memory is used to store a computer program, and the processor is used to implement the above-described low-light image enhancement method based on a trainable HSL color gamut distribution when the computer program is executed.

[0117] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a computer, implements the aforementioned low-light image enhancement method based on trainable HSL color gamut distribution.

[0118] Based on the same inventive concept, this invention also provides a computer product comprising a computer program that, when executed by a processor, implements the aforementioned low-light image enhancement method based on trainable HSL color gamut distribution.

[0119] It should be noted that the low-light image enhancement device, low-light image enhancement equipment, computer-readable storage medium, and computer product based on trainable HSL color gamut distribution provided in the above embodiments all belong to the same inventive concept as the low-light image enhancement method based on trainable HSL color gamut distribution. For details of their specific implementation process, please refer to the embodiments of the low-light image enhancement method based on trainable HSL color gamut distribution, which will not be repeated here.

[0120] The specific embodiments described above illustrate the technical solution and beneficial effects of the present invention in detail. It should be understood that the above description is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, additions, and equivalent substitutions made within the scope of the principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A low-light image enhancement method based on trainable HSL color gamut distribution, characterized in that, Includes the following steps: The RGB color gamut data distribution of a low-light RGB image is converted to the HSL color gamut data distribution. The HSL color gamut data distribution is then adjusted using a transformation function to obtain the target color gamut data distribution. This includes adjusting the vector HSL = (H, S, L) of the HSL color gamut data distribution using a transformation function, where H represents hue, S represents saturation, and L represents brightness. The transformation function formula is as follows: XYZ=f(H,S,L) Where XYZ are the new three-dimensional coordinates that map the HSL color gamut data distribution to the target color gamut data distribution, and f(·) is the transformation function; The specific calculation steps for the transformation function f(·) are as follows: θ = clamp(L - 0.5, -0.5, 0.5) Where θ is the adjusted hue value, and clamp(·) is the numerical constraint function; color_sensitive=(cos(θ·π)+ε) k Where color_sensitive is the color sensitivity, ε is a small constant, k is the compactness exponent, and k is the parameter to be optimized in the conversion function; c x =cos(2·π·H) c y =sin(2·π·H) Among them, c x c is the cosine value of the hue. y Let be the sine value of the hue, cos(·) be the cosine function, and sin(·) be the sine function; X=color_sensitive·S·c x Y=color_sensitive·S·c y Z = L Where X, Y, and Z are three coordinate values ​​in the new three-dimensional coordinates of the target color gamut data distribution, with X and Y representing color and Z representing brightness; The target color gamut data distribution is input into the brightness enhancement module and color noise reduction module of the deep learning model respectively. The results of the two modules are then fused to output the enhanced target color gamut image. The enhanced target color gamut image is then subjected to inverse color gamut transformation to finally obtain the enhanced RGB image. The bright RGB image corresponding to the low-light RGB image is used as the second label, and the target color gamut image after adjusting the data distribution of the bright RGB image is used as the first label. The target color gamut loss is constructed based on the first label and the enhanced target color gamut image, and the RGB color gamut loss is constructed based on the second label and the enhanced RGB image. The deep learning model is trained based on the target color gamut loss and the RGB color gamut loss and the transformation function is optimized at the same time. That is, the HSL color gamut data distribution is adjusted through training. The optimized transformation function is used to transform the RGB color gamut of the new low-light RGB image to the target color gamut. The image is then input into the trained deep learning model for inference. The inference result is then subjected to inverse color gamut transformation to ultimately achieve low-light image enhancement.

2. The low-light image enhancement method based on trainable HSL color gamut distribution according to claim 1, characterized in that, The process of inputting the target color gamut data distribution into the brightness enhancement module and color denoising module of the deep learning model respectively, and then fusing the results of the two modules to output an enhanced target color gamut image includes: Both the brightness enhancement module and the color denoising module of the deep learning model use U-Net with a fusion cross-attention mechanism for data processing. The brightness enhancement module enhances the brightness of the target color gamut data distribution, and the color denoising module denoises the target color gamut data distribution. Finally, the outputs of the brightness enhancement module and the color denoising module are fused to obtain the enhanced target color gamut image.

3. The low-light image enhancement method based on trainable HSL color gamut distribution according to claim 2, characterized in that, The brightness enhancement module and color denoising module of the deep learning model both use U-Net with a fused cross-attention mechanism for data processing, including: In the brightness enhancement path of the deep learning model's data processing, the brightness enhancement module includes a first encoder, a first integrated cross-attention module, a second encoder, a second integrated cross-attention module, a third integrated cross-attention module, a first decoder, a fourth integrated cross-attention module, and a second decoder connected in sequence, with a first skip connection established between the first integrated cross-attention module and the fourth integrated cross-attention module. In the color denoising path of the deep learning model's data processing, the color denoising module includes a third encoder, a first integrated cross-attention module, a fourth encoder, a second integrated cross-attention module, a third integrated cross-attention module, a third decoder, a fourth integrated cross-attention module, and a fourth decoder connected in sequence, with a second skip connection established between the first integrated cross-attention module and the fourth integrated cross-attention module. By inputting the target color gamut data distribution into the first encoder and the third encoder respectively, and then passing it through the brightness enhancement path and the color denoising path respectively, the outputs of the second decoder and the fourth decoder are obtained respectively. The outputs of the second decoder and the fourth decoder are fused to obtain an enhanced target color gamut image. Each integrated cross-attention module includes a luminance cross-attention module and a color cross-attention module. The luminance cross-attention module obtains a query Q based on the intermediate input of the luminance enhancement path and a key K and a value V based on the input of the color denoising path. It then calculates the intermediate output of the luminance enhancement path through cross-attention. The color cross-attention module obtains a key K and a value V based on the intermediate input of the luminance enhancement path and a query Q based on the input of the color denoising path. It then calculates the intermediate output of the color denoising path through cross-attention. The intermediate inputs here correspond to the previous encoder, integrated cross-attention module, or decoder adjacent to the current integrated cross-attention module. The intermediate outputs here correspond to the next encoder, integrated cross-attention module, or decoder adjacent to the current integrated cross-attention module.

4. The low-light image enhancement method based on trainable HSL color gamut distribution according to claim 1, characterized in that, Both RGB color gamut loss and target color gamut loss include: Charbonnier loss, structural similarity loss, edge loss, and perceptual loss.

5. The low-light image enhancement method based on trainable HSL color gamut distribution according to claim 1, characterized in that, By dividing color gamut conversion, model inference, and inverse color gamut transformation into three threads, the color gamut conversion, model inference, and inverse color gamut transformation of multiple images are performed in parallel through the three threads respectively.

6. A low-light image enhancement device based on a trainable HSL color gamut distribution, implemented using the low-light image enhancement method based on a trainable HSL color gamut distribution as described in any one of claims 1-5, characterized in that, include: The system includes a color gamut data distribution adjustment module, a deep learning model building module, a model training and parameter optimization module, and a low-light image enhancement module. The color gamut data distribution adjustment module is used to convert the RGB color gamut data distribution of a low-light RGB image into an HSL color gamut data distribution, and to adjust the HSL color gamut data distribution based on a conversion function to obtain the target color gamut data distribution. The deep learning model building module is used to input the target color gamut data distribution into the brightness enhancement module and the color noise reduction module of the deep learning model respectively, and then merge the results of the two modules to output the enhanced target color gamut image. The enhanced target color gamut image is then subjected to inverse color gamut transformation to finally obtain the enhanced RGB image. The model training and parameter optimization module is used to take the bright RGB image corresponding to the low-light RGB image as the second label, and the target color gamut image after adjusting the data distribution of the bright RGB image as the first label. Based on the first label and the enhanced target color gamut image, a target color gamut loss is constructed. Based on the second label and the enhanced RGB image, an RGB color gamut loss is constructed. Based on the target color gamut loss and the RGB color gamut loss, a deep learning model is trained and the transformation function is optimized at the same time. That is, the HSL color gamut data distribution is adjusted through training. The low-light image enhancement module is used to convert the RGB color gamut of the new low-light RGB image to the target color gamut based on the optimized transformation function, and then input it into the trained deep learning model for inference. The inference result is then subjected to inverse color gamut transformation to finally achieve low-light image enhancement.

7. A low-light image enhancement device based on a trainable HSL color gamut distribution, comprising a memory and one or more processors, wherein the memory is used to store a computer program, characterized in that, The processor is configured to implement, when executing the computer program, the low-light image enhancement method based on a trainable HSL color gamut distribution as described in any one of claims 1-5.

8. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a computer, it implements the low-light image enhancement method based on trainable HSL color gamut distribution as described in any one of claims 1-5.

9. A computer product comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the low-light image enhancement method based on trainable HSL color gamut distribution as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Low-light image enhancement method based on U-shaped network and attention mechanism

    CN116596793A

  • Illumination image enhancement method based on HSV space

    CN117291818A