A method and device for night light image enhancement based on color shift correction
By using the U-Net network to extract features and calculate color offsets for image correction at night or under low-light conditions, the problem of poor image enhancement in the existing technology is solved, and higher brightness and detail retention are achieved.
Patent Information
- Application Number
- CN202411080381.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-08-08
AI Technical Summary
When dealing with image enhancement at night or under low-light conditions, existing technology is difficult to effectively correct color shifts, resulting in poor image quality, especially in under-exposed situations. There is a lack of effective training data sets and methods to improve the image quality. Brightness and detail preserved.
Using the feature extraction module, color offset estimation module and color offset correction module based on U-Net, the brightness and darkness features are extracted through the training model, the color offset is calculated, and the image is corrected to generate a contrast-enhanced and detailed image. image.
The brightness and contrast of the image are improved, while the details and color information of the image are better preserved. Experimental results show that the method performs well under low-light conditions and has good robustness and interpretability.
Smart Images

Figure CN118608441B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for enhancing a luminous image based on color shift correction. Background Art
[0002] In Internet-based technologies, images have become a crucial carrier of information presentation, which can convey and present information to us more intuitively. More than 80% of the information humans obtain from the outside world comes from the human eye, so it can be seen that humans' requirements for image quality will become higher and higher. Image processing technology has always been a hot topic and difficulty for scholars and experts to study, and its application prospects are also very broad.
[0003] Real-world scenes often involve a wide range of lighting, which poses a huge challenge to photography. Uneven scene lighting can easily produce overexposure and underexposure. Images captured under underexposure often suffer from suboptimal visibility, such as barely visible details, relatively low contrast, and dull colors. Such degraded images not only fail to capture what users want, but also challenge many computer vision tasks, so it is necessary to enhance images and obtain good visual results.
[0004] At night or in low light conditions, due to environmental factors, images captured by humans often become blurry and dim, which will reduce the shooting effect and affect the implementation of downstream tasks. Night image enhancement technology can process the captured images to achieve better display effects under low light conditions. Common night image enhancement technologies include brightness enhancement, contrast enhancement, color balance, noise suppression, etc. These technologies can improve the clarity, vividness and color reproduction of images, making the images more realistic, accurate and reliable.
[0005] Traditional low-light image enhancement methods generally include methods based on histogram equalization (HE), white balance, grayscale edge assumptions, and methods based on Retinex (Retina and Cortex) theory. Histogram equalization methods increase the contrast of images by expanding the dynamic range of global and local grayscale levels. The limitations of methods based on histogram equalization are obvious because they ignore information about image structure. Methods using Retinex theory usually decompose images into reflectance and illumination components. It is usually assumed that the reflectance component is consistent under any lighting conditions, so image enhancement is formulated as an illumination estimation problem.
[0006] Image fusion includes decision-level fusion, feature-level fusion, and data-level fusion (also called pixel-level fusion). Since the single traditional algorithm has poor processing effect, Ancuti et al. first proposed a fusion-based method. The idea of the algorithm is: first, two images for fusion are generated from the input image; then, four fusion weights are determined according to the contrast, significant features and exposure of the two images to be fused; finally, a multi-scale fusion strategy is used to fuse the two images and the determined weights to obtain an enhanced image with enhanced contrast and prominent details.
[0007] Image enhancement based on traditional algorithms has limitations, so many researchers have begun to use convolutional neural networks to enhance low-light images and proposed various network structures. Since the theory based on Retinex is more practical, some network structures have integrated Retinex theory. The idea of this type of algorithm is to extract the incident light through the trained network model, then adjust it, and then calculate the reflectivity according to the Retinex model to finally obtain an enhanced image.
[0008] Unlike other conventional visual tasks, using deep networks to solve low-light image enhancement problems is still immature. The core difficulty lies in the lack of effective training data pairs. Until researchers developed a series of paired datasets with low-light input and normal exposure labels, the development of deep network technology for low-light image enhancement was promoted. Based on this, the present invention aims to propose a night-light image enhancement algorithm based on color shift correction. Summary of the invention
[0009] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a night light image enhancement method based on color shift correction, which can process underexposed night light images to generate a normally exposed image corresponding to the night light image.
[0010] In order to achieve the above object, the solution of the present invention is:
[0011] A method for night light image enhancement based on color shift correction comprises the following steps:
[0012] Step A, night light image enhancement model design: including a U-Net-based feature extraction module, a color shift estimation module and a color shift correction module;
[0013] Step B: Select appropriate open source datasets from the sample library for experiments;
[0014] Step C, constructing a night light image enhancement model based on color shift correction;
[0015] Step C1: construct and train a feature extraction module based on U-Net; extract any image from the sample library and obtain the overexposed image corresponding to the image and underexposed images And the corresponding real image , the exposure image and underexposed images Input to the U-Net-based feature extraction module to extract the corresponding one-dimensional brightness feature map and ;
[0016] Step C2, one-dimensional brightness feature map and Estimation by brightness Get three-dimensional bright color features and three-dimensional dark features , and then the three-dimensional bright color feature and three-dimensional dark features and overexposed images Input to the fusion feature generator to obtain the fused three-dimensional brightness compensation feature map ;
[0017] Step C3: fused three-dimensional brightness compensation feature map As an auxiliary compensation information and 3D bright color feature and three-dimensional dark features The bright color offset can be obtained through the color offset estimation module. and dark offset ;
[0018] Step C4, bright color offset and dark offset and overexposed images Input to the color shift correction module to get the final model output ;
[0019] During the training phase, the night light image enhancement model estimates the brightness Get three-dimensional bright color features and three-dimensional dark features The process is calculated by the following calculation method:
[0020]
[0021]
[0022] During the training phase, the model outputs With real image The difference between them is calculated by the following loss function Perform calculations to adjust network parameters:
[0023]
[0024] in, , They are mean absolute error, cosine similarity, structural similarity loss and VGG loss. , is a hyperparameter.
[0025] Further, the step C3 specifically includes the following steps:
[0026] Step C31: input three-dimensional brightness compensation feature map With three-dimensional bright color features , merge these two features together to obtain the merged six-dimensional feature ;
[0027] Step C32, the merged six-dimensional features Then the features are obtained through color convolution, position convolution and offset convolution , , , three-dimensional brightness compensation feature map After adding, add Multiplication uses color space variable convolution to calculate the color offset and generate a bright color offset feature map ;
[0028] Step C33, inputting a three-dimensional brightness compensation feature map With three-dimensional dark features , merge these two features together to obtain the merged six-dimensional feature ;
[0029] Step C34, merged six-dimensional features Then the features are obtained through color convolution, position convolution and offset convolution , , , three-dimensional brightness compensation feature map After adding, add Multiplication uses color space variable convolution to calculate the color offset and generate a dark color offset feature map .
[0030] Further, the step C4 specifically includes the following steps:
[0031] Step C41, input bright color offset , respectively, after three 1*1 convolutions , , , get the features , , , enter the dark offset , after 3 1*1 convolutions , , , get the features , , , input transition exposure image , after 3 1*1 convolutions , , , get the features , , ;
[0032] Step C42, the convolution result , , , , Generate enhanced images through cross-attention mechanism ;
[0033] Furthermore, the step C further includes a step D: training the constructed luminous image enhancement model to obtain the model parameters of the final color shift correction model, testing the image, and inputting the image. , get the image after color shift correction .
[0034] Another object of the present invention is to overcome the shortcomings of the prior art and provide a night light image enhancement device based on color shift correction, which can process underexposed night light images to generate a normally exposed image corresponding to the night light image.
[0035] In order to achieve the above object, the solution of the present invention is:
[0036] A night-light image enhancement device based on color shift correction includes a model building and training module, wherein the model building and training module has a night-light image enhancement model to process the night-light image, thereby obtaining a night-light image after color shift correction;
[0037] The model construction and training module is constructed and trained using the night-light image enhancement method based on color shift correction to obtain the night-light image enhancement model based on color shift correction.
[0038] After adopting the above structure, the method and device for night-light image enhancement based on color shift correction of the present invention takes into account the robustness and interpretability of the model, and adopts a U-Net network to extract overexposed and underexposed image features, and then generates a brightness compensation feature map through a fusion feature generator. The color shift module is used to estimate the color shift between the color feature map and the brightness compensation feature map of the night-light image. Finally, the color shift of the image is corrected according to these shifts to achieve night-light image enhancement. Experimental results show that the present invention can not only improve the brightness of the image, but also better preserve the image details and color information. In addition, the ablation study results highlight the excellent model performance of the method of the present invention. The effectiveness of the color shift correction proposed by the present invention for night-light image enhancement is verified by experiments.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] (1) The present invention uses a U-Net network to extract overexposed and underexposed image features, and then generates a brightness compensation feature map through a fusion feature generator.
[0041] (2) The present invention estimates the color shift between the color feature map and the brightness compensation feature map of the night light image through a color shift module, and then corrects the color shift of the image according to these shifts to achieve night light image enhancement.
[0042] (3) The present invention conducts experiments on a low-light image dataset and compares it with other methods. The experimental results show that the present invention can not only improve the brightness of the image, but also better preserve the image details and color information. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flow chart of the present invention.
[0044] Figure 2 It is a schematic diagram of the principle of the luminous image enhancement model based on color correction of the present invention.
[0045] Figure 3 It is a schematic diagram of the principle of the color estimation model of the present invention.
[0046] Figure 4 It is a schematic diagram of the principle of the color correction model of the present invention.
[0047] Figure 5 This is the prediction result of the color shift correction model of the present invention on the low-light image dataset. DETAILED DESCRIPTION
[0048] With the all-round changes brought about by artificial intelligence technology, the need for perception in real scenes is becoming increasingly urgent. As an important medium for perceiving the world, the quality of images often determines the performance of algorithms. Among the various factors that affect image quality, low light factors are more common and difficult to avoid, such as cloudy days, night scenes, etc.
[0049] In order to solve this problem, the present invention introduces a night-light image enhancement method based on color shift correction. Specifically, the present invention uses a U-Net network to extract overexposed and underexposed image features, and then generates a brightness compensation feature map through a fusion feature generator. The color shift module is used to estimate the color shift between the color feature map and the brightness compensation feature map of the night-light image. Finally, the color shift of the image is corrected according to these offsets to achieve night-light image enhancement. By evaluating the model on the data set, the present invention can not only improve the brightness of the image, but also better retain the image details and color information. The technical scheme and beneficial effects of the present invention will be described in detail below in conjunction with the accompanying drawings.
[0050] like Figure 1 As shown, the present invention provides a night light image enhancement method based on color shift correction, comprising the following steps:
[0051] Step A, model design: including a U-Net-based feature extraction module, a color shift estimation module, and a color shift correction module;
[0052] Step B: Select appropriate open source datasets from the sample library for experiments;
[0053] Step C, constructing a night light image enhancement model based on color shift correction;
[0054] Step D: train the constructed night light image enhancement model to obtain the model parameters of the final color shift correction model, test the image, and input the image , get the image after color shift correction .
[0055] like Figure 2 FIG. 1 is a schematic diagram of the night light image enhancement model in step C, which describes the detailed process of processing the night light image to output the color correction result, specifically including the following steps:
[0056] Step C1: Build and train a U-Net-based feature extraction module; extract any image from the sample library and obtain the overexposed image corresponding to the image and underexposed images And the corresponding real image , the two images and Input to the U-Net-based feature extraction module to extract the corresponding one-dimensional brightness feature map and .
[0057] Step C2: One-dimensional brightness feature map and Estimation by brightness Get three-dimensional bright color features and three-dimensional dark features , and then the obtained three-dimensional bright color feature and three-dimensional dark features And images Input to the fusion feature generator to obtain the fused three-dimensional brightness compensation feature map .
[0058] Step C3: Fused 3D brightness compensation feature map As an auxiliary compensation information and 3D bright color feature and three-dimensional dark features The bright color offset can be obtained through the color offset estimation module. and dark offset .
[0059] Step C4: Light Color Offset and dark offset and overexposed images Input into the Color Cast Correction module to get the final result .
[0060] In step C2, the night light image enhancement model estimates the brightness Get three-dimensional bright color features and three-dimensional dark features The process is calculated by the following calculation method:
[0061] (1)
[0062] (2)
[0063] In step C4, the output of the night light image enhancement model With real image The difference between them is calculated by the following loss function Perform calculations to adjust network parameters:
[0064] (3)
[0065] in, , They are Mean Absolute Error (MAE), cosine similarity, structural similarity loss (SSIM) and VGG loss. , is a hyperparameter.
[0066] Figure 3 The schematic diagram of the color shift estimation model provided by the present invention is shown, which describes the detailed process of processing the night light image to perform color shift estimation, which specifically includes the following steps:
[0067] Step C31: Input three-dimensional brightness compensation feature map With three-dimensional bright color features , merge these two features together to obtain the merged six-dimensional feature .
[0068] Step C32: Merged six-dimensional features Then the features are obtained through color convolution, position convolution and offset convolution , , , three-dimensional brightness compensation feature map After adding Multiplication uses color space variable convolution to calculate the color offset and generate bright color offset features .
[0069] Step C33: Input three-dimensional brightness compensation feature map With three-dimensional dark features , merge these two features together to obtain the merged six-dimensional feature .
[0070] Step C34: Merged six-dimensional features Then the features are obtained through color convolution, position convolution and offset convolution , , , After adding the features, Multiplication uses color space variable convolution to calculate the color offset and generate dark offset features .
[0071] Figure 4 The schematic diagram of the color shift correction model provided by the present invention is shown, which describes the detailed process of processing the night light image to output the color correction result, which specifically includes the following steps:
[0072] Step C41: Input Bright Color Offset Feature , respectively, after three 1*1 convolutions , , , get the features , , , enter the dark offset , after 3 1*1 convolutions , , , get the features , , , input image , after 3 1*1 convolutions , , , get the features , , .
[0073] Step C42: Convolution result , , , , Generate enhanced images through cross-attention mechanism .
[0074] As a preferred embodiment of the present invention, we used LCDP and MSEC from a synthetic and real low-light image enhancement dataset MIT-Adobe FiveK. LCDP contains 1733 pictures, 1415 for training, 100 for verification, and 218 for testing, and LCDP contains overexposed and underexposed areas to test the ability of this project for overexposure and underexposure conditions. The MSEC dataset contains 17675 training images, 750 verification images, and 5905 test images. MSEC contains exposed and underexposed images, whose exposure values are in the set of {-1.5V, -1V, 0EV, +1EV, +1.5EV}, and uses images modified by experts as Ground Truth. The present invention conducted experiments on this dataset to test the generalization ability of the present invention.
[0075] Figure 5 Figure 2 shows the prediction results of the color shift correction model provided by the present invention on a low-light image dataset. Figure 5 It can be seen that the model can correct the color shift of night light images very well.
[0076] The above embodiments and drawings do not limit the product form and style of the present invention. Any appropriate changes or modifications made by ordinary technicians in the relevant technical field should be deemed to be within the patent scope of the present invention.
Claims
1. A night light image enhancement method based on color shift correction, characterized in that: The steps include: Step A, night light image enhancement model design: including a U-Net-based feature extraction module, a color shift estimation module and a color shift correction module; Step B: Select open source datasets from the sample library for experiments; Step C, constructing a night light image enhancement model based on color shift correction; Step C specifically includes the following steps: Step C1: construct and train a feature extraction module based on U-Net; extract any image from the sample library and obtain the overexposed image corresponding to the image and underexposed images And the corresponding real image , the exposure image and underexposed images Input to the U-Net-based feature extraction module to extract the corresponding one-dimensional brightness feature map and ; Step C2, one-dimensional brightness feature map and Estimation by brightness Get three-dimensional bright color features and three-dimensional dark features , and then the three-dimensional bright color feature and three-dimensional dark features and overexposed images Input to the fusion feature generator to obtain the fused three-dimensional brightness compensation feature map ; Step C3: fused three-dimensional brightness compensation feature map As an auxiliary compensation information and 3D bright color feature and three-dimensional dark features The bright color offset is obtained by the color offset estimation module. and dark offset ; Step C3 specifically comprises the following steps: Step C31: input three-dimensional brightness compensation feature map With three-dimensional bright color features , merge these two features together to obtain the merged six-dimensional feature ; Step C32, the merged six-dimensional features Then the features are obtained through color convolution, position convolution and offset convolution , , , three-dimensional brightness compensation feature map After adding, add Multiply, use color space variable convolution to calculate the color offset, and generate a bright color offset feature map ; Step C33, inputting a three-dimensional brightness compensation feature map With three-dimensional dark features , merge these two features together to obtain the merged six-dimensional feature ; Step C34, merged six-dimensional features Then the features are obtained through color convolution, position convolution and offset convolution , , , After adding, add Multiplication uses color space variable convolution to calculate the color offset and generate a dark color offset feature map ; Step C4, bright color offset and dark offset and overexposed images Input to the color shift correction module to get the final model output ; During the training phase, the night light image enhancement model estimates the brightness Get three-dimensional bright color features and three-dimensional dark features The process is calculated by the following calculation method: During the training phase, the model outputs With real image The difference between them is calculated by the following loss function Perform calculations to adjust network parameters: in, , They are mean absolute error, cosine similarity, structural similarity loss and VGG loss. , is a hyperparameter.
2. The method for night light image enhancement based on color shift correction as claimed in claim 1, characterized in that: The step C4 specifically comprises the following steps: Step C41, input bright color offset , respectively, after 3 1*1 convolutions , , , get the features , , , enter the dark offset , after 3 1*1 convolutions , , , get the features , , , input transition exposure image , after 3 1*1 convolutions , , , get the features , , ; Step C42, the convolution result , , , , Generate enhanced images through cross-attention mechanism .
3. The method for night light image enhancement based on color shift correction as claimed in claim 1, characterized in that: The step C also includes step D: training the constructed night light image enhancement model to obtain the model parameters of the final color shift correction model, testing the image, and inputting the image. , get the image after color shift correction .
4. A night light image enhancement device based on color shift correction, characterized in that: The method comprises a model building and training module, wherein the model building and training module has a luminous image enhancement model for processing the luminous image, thereby obtaining a luminous image after color shift correction; The model construction and training module is constructed and trained using the night-light image enhancement method based on color shift correction as described in any one of claims 1 to 3 to obtain the night-light image enhancement model based on color shift correction.
Citation Information
Patent Citations
Mine image enhancement method
CN118314056A
Low-illumination image enhancement method using long-exposure compensation
WO2023236445A1
