Dark light enhancement method based on neural network
Through the multi-layer convolutional neural network and multi-task learning framework based on neural networks, combined with data enhancement and post-processing algorithms, the problem of detail loss and noise suppression in traditional dark light enhancement methods is solved, and the effective brightness improvement of low-light images is achieved. and detail preservation, significantly improving image quality.
Patent Information
- Application Number
- CN202410679826.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-10
AI Technical Summary
Traditional dark light enhancement methods easily lead to loss of details while improving image brightness, are difficult to balance brightness enhancement and noise suppression, and are difficult to adapt to local area processing under different lighting conditions.
Using a neural network-based method, through data preprocessing and neural network model construction, including multi-layer convolutional neural network, multi-layer feature pyramid structure, adaptive 3D LUT, skip connection and multi-task learning framework, combined with data enhancement technology and Post-processing algorithms, such as non-local mean and Retinex algorithms, perform image enhancement and denoising.
It effectively improves the brightness and clarity of low-light images, retains image details, reduces noise, improves image quality, and performs consistently under different lighting conditions.
Smart Images

Figure CN118628388A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a dark light enhancement method based on a neural network. Background Art
[0002] Low-light enhancement refers to processing images under low-light conditions to improve their brightness, contrast, and clarity, making them visually closer to images under normal lighting conditions. The significance of low-light enhancement is to improve the quality of images taken in low-light environments and enhance the user's visual experience. It has important application value in fields such as night photography, surveillance, and medical imaging.
[0003] Traditional methods can easily lead to loss of image details while improving image brightness, and cannot balance brightness enhancement and detail retention. Images taken under low-light conditions are usually accompanied by high noise levels. Traditional methods are difficult to effectively remove noise during the brightness enhancement process, resulting in obvious noise in the enhanced image. Traditional methods often process the entire image and are difficult to adapt to the lighting conditions of different areas in the image, resulting in unsatisfactory local enhancement effects.
[0004] It can be seen that images taken under low-light conditions are usually affected by a variety of factors, resulting in a decrease in image quality, such as insufficient brightness, increased noise, and loss of details. Traditional image enhancement techniques are difficult to improve image brightness while retaining details and suppressing noise. With the rapid development of deep learning technology, neural network-based methods have shown great potential in the field of image processing. Neural networks, especially convolutional neural networks (CNNs), can effectively solve image enhancement problems through their powerful feature extraction and nonlinear mapping capabilities. Summary of the invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art.
[0006] To this end, the present invention provides a dark light enhancement method based on a neural network.
[0007] The present invention provides a dark light enhancement method based on a neural network, and the dark light enhancement method based on a neural network is characterized by comprising the following steps:
[0008] Data preprocessing, including normalizing low-light images and using data augmentation techniques to generate diverse training samples;
[0009] Build a neural network model, including an input layer, multiple convolutional layers, a pooling layer, an activation function layer, and an output layer;
[0010] Train the neural network model, use the preprocessed image dataset, adopt the Adam optimization algorithm, use the mean square error as the loss function, and optimize the network parameters through the back propagation algorithm;
[0011] Image enhancement: input the low-light image to be enhanced into the trained neural network model and generate the enhanced image through forward propagation;
[0012] Post-processing, noise suppression and detail processing are performed on the enhanced image.
[0013] The dark light enhancement method based on a neural network according to the above technical solution of the present invention may also have the following additional technical features:
[0014] In the above technical solution, the data enhancement technology includes randomly rotating the image at an angle between -10° and 10°, randomly cropping the image to retain 80% to 100% of the original image area, horizontally flipping the image, and adding Gaussian noise with a mean of 0 and a variance range of 0.01 to 0.05.
[0015] In the above technical solution, the data preprocessing also includes pairing the low-light image with a plurality of high-light reference images under different lighting conditions for supervised learning.
[0016] In the above technical solution, the training samples are processed in batches, each batch includes 32 images, and during the training process, each batch of images is subjected to data enhancement processing such as random rotation, cropping, flipping and noise addition.
[0017] In the above technical solution, the post-processing also includes adjusting the contrast of the enhanced image and using a histogram equalization method to even out the image brightness.
[0018] In the above technical solution, the detail processing includes applying a multi-scale Retinex algorithm and a guided filter, and the parameters of the guided filter are adjusted according to specific characteristics of the image to enhance the edge details of the image.
[0019] In the above technical solution, the neural network model adopts a multi-layer feature pyramid structure to process features at different resolution levels, and each feature layer is processed independently and then fused.
[0020] In the above technical solution, the neural network model uses an adaptive 3D LUT for color correction. The parameters of the adaptive 3D LUT are obtained by learning a large amount of training data, and combined with a generative adversarial network (GAN) for unsupervised learning, and the adversarial training of the discriminator and the generator is used to optimize the image.
[0021] In the above technical solution, a skip connection is introduced into the neural network model, allowing low-level features to be directly transmitted to high-level layers to achieve feature fusion.
[0022] In the above technical solution, dark light enhancement and denoising training are performed simultaneously through a multi-task learning framework, and multiple output heads are set in the same network, which are used for dark light enhancement and denoising respectively.
[0023] In summary, due to the adoption of the above technical features, the beneficial effects of the present invention are:
[0024] The present invention realizes effective enhancement of low-light images by constructing a multi-layer convolutional neural network and combining a multi-layer feature pyramid structure and an adaptive 3D LUT, improves the brightness of the image, and significantly improves it under different lighting conditions. In the image enhancement process, by introducing jump connections and a multi-task learning framework, low-level features can be directly transferred to high-level layers to achieve feature fusion, effectively retain image details, and improve image clarity and detail expression. Through the non-local mean (NLM) algorithm and Gaussian filtering in post-processing, the enhanced image is subjected to noise suppression to reduce noise in the image and improve the image quality. Adaptive 3D LUT is applied for color correction to adjust the hue, brightness and contrast of the image, so that the enhanced image is more vivid and natural in color expression. Histogram equalization and adaptive histogram equalization (CLAHE) technology are used to adjust the contrast of the image and optimize the brightness distribution of the image, so that the visual effect of the image is more natural and the sense of hierarchy is stronger. Through a multi-task learning framework, dark light enhancement and denoising training are performed simultaneously, and multiple tasks are optimized in the same training process to improve the comprehensive ability of the model.
[0025] Additional aspects and advantages of the present invention will become apparent from the following description or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0027] Figure 1 It is a flowchart of a dark light enhancement method based on a neural network according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0029] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0030] Refer to the following Figure 1 To describe the dark light enhancement method based on neural network provided according to some embodiments of the present invention.
[0031] Some embodiments of the present application provide a dark light enhancement method based on a neural network.
[0032] like Figure 1 As shown, the first embodiment of the present invention proposes a dark light enhancement method based on a neural network, including five steps: data preprocessing, neural network model construction, model training, image enhancement and post-processing.
[0033] Data preprocessing: Normalize low-light images and unify the pixel value range to [0,1]. Generate diverse training samples using data enhancement techniques, which include random rotation, cropping, flipping, and Gaussian noise addition. In a specific embodiment, the specific parameters of data enhancement are a rotation angle range of -10° to 10°, cropping to retain 80% to 100% of the original image area, a noise mean of 0, and a variance range of 0.01 to 0.05. That is, the image is randomly rotated between -10° and 10°, 80% to 100% of the original image area is randomly cropped, horizontally flipped, and Gaussian noise with a mean of 0 and a variance range of 0.01 to 0.05 is added. Among them, the diversity of training samples is increased by setting the rotation angle range. By cropping different areas of the original image, images under different shooting angles and scenes are simulated. By horizontally flipping, the symmetry of the image is enhanced and the richness of the data set is increased. By adding Gaussian noise, the robustness of the model to noise is enhanced. The above settings can enhance data diversity and improve the generalization ability of the model.
[0034] Specifically, the normalization process is to normalize the pixel values of low-light images to the range of [0,1] to eliminate the brightness differences between different images. The normalization formula is:
[0035] I'=(I-min(I)) / (max(I)-min(I))
[0036] Among them, I is the original image and I' is the normalized image.
[0037] In some embodiments, data preprocessing also includes pairing low-light images with high-light reference images under a variety of different lighting conditions for supervised learning. Specifically, images taken under a variety of lighting conditions are collected, including low-light and high-light images. The high-light image is used as a reference image to provide details and color information under normal lighting. Each low-light image is paired with its corresponding high-light image to form a training data set. For each pair of images, ensure that they have the same scene and perspective, but different lighting conditions. Label each pair of images with corresponding labels to indicate the correspondence between the low-light image and the high-light image. These labels are used for supervised learning so that the neural network can learn how to generate high-light images from low-light images. In this embodiment, through pairing, the neural network can obtain more reference information and improve the enhancement effect. Provide clear goals so that the neural network can better learn the mapping relationship between generating high-light images from low-light images. By selecting different scenes and lighting conditions, the diversity of data is enhanced and the generalization ability of the model is improved.
[0038] Neural network model construction: Construct a multi-layer convolutional neural network (CNN), including an input layer, multiple convolution layers, a pooling layer, an activation function layer, and an output layer. Each convolution layer includes multiple 3x3 convolution kernels, the pooling layer is a 2x2 maximum pooling, and the activation function layer uses a ReLU activation function. The multi-layer feature pyramid structure processes features at different resolution levels, and each feature layer is processed independently before being fused.
[0039] In some embodiments, the neural network model can be optimized by means of a multi-layer feature pyramid structure, an adaptive 3D LUT, and skip connections.
[0040] In a specific embodiment, a multi-layer feature pyramid structure is used to optimize the neural network model. The multi-layer feature pyramid structure can process image features at different resolution levels, retain more detail information, and help improve the model's ability to capture details.
[0041] Specifically, multiple convolutional layers are constructed in the neural network, and each convolutional layer uses a 3x3 convolution kernel to extract different levels of image features. For example, 32 3x3 convolution kernels are used to extract low-level features, 64 3x3 convolution kernels are used to extract medium-level features, and 128 3x3 convolution kernels are used to extract high-level features.
[0042] Feature extraction is performed at different resolutions, and the feature maps are processed layer by layer from high to low resolution to form a feature pyramid. In each layer, the feature map is downsampled using a maximum pooling layer (2x2) to retain important feature information.
[0043] Features at different resolution levels are fused to improve the image enhancement effect. Through deconvolution or upsampling operations, the low-resolution feature map is enlarged to the same size as the high-resolution feature map, and then feature fusion is performed.
[0044] In a specific embodiment, an adaptive 3D LUT is used to optimize the neural network model. The adaptive 3D LUT (lookup table) can perform color correction according to different features of the image to improve the color expression of the image.
[0045] Specifically, by learning a large amount of training data, an adaptive 3D LUT is generated, and the parameters include a color transformation matrix and a color lookup table. The 3D LUT can adjust the color performance of the output image according to the color characteristics of the input image.
[0046] In the process of image enhancement, adaptive 3D LUT is applied to perform color correction on the image to adjust the image's hue, brightness and contrast. Its expression is:
[0047] I_out=LUT(I_in)
[0048] Among them, I_in is the input image, LUT is the lookup table, and I_out is the output image.
[0049] In a specific embodiment, skip connections are used to optimize the neural network model. The introduction of skip connections enables low-level features to be directly transferred to high-level layers, achieving feature fusion and avoiding information loss.
[0050] Specifically, skip connections are set between different layers of the neural network so that low-level features can be directly passed to high-level layers. For example, a skip connection is set between the 1st convolutional layer and the 3rd convolutional layer.
[0051] The low-level features are integrated with the high-level features to enhance the feature expression capability. The expression is:
[0052] F_out=F_low+F_high
[0053] Among them, F_low is the low-level feature, F_high is the high-level feature, and F_out is the fused feature.
[0054] Model training: The neural network is trained using the preprocessed image dataset, using the Adam optimization algorithm, with an initial learning rate of 0.001, using the mean square error (MSE) as the loss function, and optimizing the network parameters through the back propagation algorithm. The training dataset is processed in batches, with each batch containing 32 images.
[0055] Specifically, the Adam optimization algorithm is used with an initial learning rate of 0.001, and back propagation is performed to minimize the loss function value. The Adam optimization algorithm can accelerate the convergence of the model. The loss function is designed to measure the difference between the enhanced image and the reference image, and the mean square error (MSE) is used as the loss function. Among them, the loss function is:
[0056] MSE=(1 / n)*sum((Y_pred-Y_true)^2)
[0057] Where Y_pred is the predicted output, Y_true is the reference image, and n is the number of samples. By minimizing MSE, the difference between the predicted output and the reference image can be reduced, thus improving the accuracy of the model.
[0058] In a specific embodiment, the training process includes four steps: forward propagation, loss calculation, back propagation, and parameter update. The training data set is processed in batches, each batch includes 32 images, and during the training process, each batch of images is subjected to data enhancement processing such as random rotation, cropping, flipping, and noise addition.
[0059] Image enhancement: The low-light image to be enhanced is input into the trained neural network model, and the enhanced high-brightness image is generated through forward propagation. The gradient of the loss function relative to the network parameters is calculated through the back-propagation algorithm, and the network parameters are updated. The enhanced image is output and subjective and objective evaluation is performed. By comparing the images before and after enhancement, it can be clearly seen that the brightness and clarity are improved, and the details are effectively preserved.
[0060] Specifically, an image taken under low light conditions is selected and normalized. The preprocessed image is input into the trained neural network model. The image is forward propagated through the model, features are extracted through multiple convolutional layers and pooling layers, and nonlinear transformation is performed through activation functions. In the output layer, the feature map is restored to the original image size through deconvolution operations to generate an enhanced image. The enhanced high-brightness image is output and visually inspected and evaluated for quality. The above steps can realize the transformation of an image with low brightness, blurred details and more noise before enhancement into an image with significantly improved brightness, clear details and reduced noise after enhancement.
[0061] Post-processing: Noise suppression and detail processing are performed on the enhanced image, including the application of multi-scale Retinex algorithm and guided filter, and contrast adjustment uses histogram equalization method.
[0062] Specifically, in post-processing, the non-local means (NLM) algorithm is used to suppress noise in the enhanced image to remove noise caused by low light conditions. The multi-scale Retinex algorithm is used to enhance the details of the image to improve the detail expression of the image. The guided filter is applied to enhance the edge details and improve the clarity of the image. The parameters of the guided filter can be adjusted according to the specific characteristics of the image to obtain the best detail enhancement effect. Through these post-processing steps, the image quality is further improved, the brightness is uniform, the details are clear, the noise is reduced, and the enhanced image is more in line with the visual perception of the human eye.
[0063] In a specific embodiment, the non-local means algorithm removes noise by performing a weighted average of similar regions on each pixel of the image. The non-local means algorithm includes:
[0064] NLM(p)=(1 / Z(p))*sum(exp(-(I(p)-I(q))^2 / h^2)*I(q))
[0065] Where p and q are pixels in the image, I(p) and I(q) are the corresponding pixel values, h is the filtering parameter, and Z(p) is the normalization factor.
[0066] Among them, the similar area of each pixel is calculated, and the weighted average pixel is selected. The non-local mean algorithm is applied to each pixel to obtain the denoised pixel value.
[0067] In some embodiments, based on the NLM algorithm, Gaussian filtering can be further applied to smooth the image. This includes: constructing a Gaussian kernel, the kernel size is determined according to the image size and noise level. Performing a convolution operation on the image to obtain a smoothed image. Specifically:
[0068] G(x,y)=(1 / (2πσ^2))*exp(-(x^2+y^2) / (2σ^2))
[0069] Where σ is the standard deviation.
[0070] In a specific embodiment, on the basis of noise suppression, the edge and texture information of the image is further enhanced by detail processing technology to make the image clearer. The multi-scale Retinex algorithm simulates the human visual system to perform dynamic range compression and detail enhancement on the image. The formula of the multi-scale Retinex algorithm is:
[0071] R(x,y)=log(I(x,y))-log(F(x,y)*I(x,y))
[0072] Among them, R(x,y) is the processed image, I(x,y) is the original image, and F(x,y) is the image after Gaussian filtering.
[0073] Specifically, multiple scales of Gaussian filtering are applied to the image to obtain images of different scales. The Retinex formula is applied to each scale of the image for processing. The multi-scale processed images are fused to obtain the final detail-enhanced image.
[0074] Guided filtering is an edge-preserving smoothing filter that preserves edge details by introducing a guide image during the filtering process. The formula for guided filtering is:
[0075] q_i=a_i*I_i+b_i,
[0076] Among them, q_i is the output image, I_i is the input image, and a_i and b_i are filtering parameters.
[0077] Specifically, the filtering parameters a_i and b_i of each pixel are calculated according to the local mean and variance of the input image and the guide image, and the guided filtering formula is applied to each pixel to obtain a smooth image with edge preservation.
[0078] In a specific embodiment, by adjusting the contrast, the brightness distribution of the image can be further optimized to make the visual effect of the image more natural. For example, by using histogram equalization to adjust the distribution of image pixel values, the contrast of the image can be enhanced.
[0079] Specifically, the histogram of the image is calculated to obtain the frequency of each gray level. The cumulative distribution function (CDF) is calculated to map the pixel values of the original image to the new gray level. The new gray level mapping is applied to obtain the image with enhanced contrast.
[0080] In other embodiments, based on histogram equalization, local area histogram equalization is introduced to form adaptive histogram equalization (CLAHE) to avoid over-enhancement. Specifically, the image is divided into multiple local areas, and histogram equalization is performed on each local area. The results of adjacent local areas are interpolated to obtain the final equalized image.
[0081] In some embodiments, through the multi-task learning framework, dark light enhancement and denoising training can be performed simultaneously to improve the training efficiency and the comprehensive ability of the model. Specifically, multiple output heads are set in the same network, which are used for dark light enhancement and denoising respectively. For example, the last layer of the network sets two output heads, one for outputting the enhanced image and the other for outputting the denoised image. Define multiple loss functions, which are used for different tasks respectively, and optimize them by weighted summation. The expression is:
[0082] L_total=w1*L_enhance+w2*L_denoise
[0083] Among them, L_total is the total loss, L_enhance is the loss of the enhancement task, L_denoise is the loss of the denoising task, and w1 and w2 are the weights of the two respectively.
[0084] In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0085] Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A dark light enhancement method based on neural network, characterized in that: The following steps are involved: Data preprocessing, including normalizing low-light images and using data augmentation techniques to generate diverse training samples; Build a neural network model, including an input layer, multiple convolutional layers, a pooling layer, an activation function layer, and an output layer; Train the neural network model, use the preprocessed image dataset, adopt the Adam optimization algorithm, use the mean square error as the loss function, and optimize the network parameters through the back propagation algorithm; Image enhancement: input the low-light image to be enhanced into the trained neural network model and generate the enhanced image through forward propagation; Post-processing, noise suppression and detail processing are performed on the enhanced image.
2. The method according to claim 1, characterized in that: The data augmentation techniques include random rotation of the image with an angle between -10° and 10°, random cropping with 80% to 100% of the original image area retained, horizontal flipping, and adding Gaussian noise with a mean of 0 and a variance range of 0.01 to 0.
05.
3. The method according to claim 1, characterized in that The data preprocessing also includes pairing the low-light images with high-light reference images under a variety of different lighting conditions for supervised learning.
4. The method according to claim 1, characterized in that The training samples are processed in batches, each batch includes 32 images, and during the training process, the images in each batch are subjected to data enhancement processing such as random rotation, cropping, flipping and noise addition.
5. The method according to claim 1, characterized in that The post-processing also includes adjusting the contrast of the enhanced image and using a histogram equalization method to perform uniform processing on the image brightness.
6. The method according to claim 1, characterized in that The detail processing includes applying a multi-scale Retinex algorithm and a guided filter, and the parameters of the guided filter are adjusted according to specific characteristics of the image to enhance the edge details of the image.
7. The method according to claim 1, characterized in that The neural network model adopts a multi-layer feature pyramid structure to process features at different resolution levels, and each feature layer is processed independently and then fused.
8. The method according to claim 1, characterized in that: The neural network model uses an adaptive 3D LUT for color correction. The parameters of the adaptive 3D LUT are obtained by learning a large amount of training data, and are combined with a generative adversarial network (GAN) for unsupervised learning, and the adversarial training of the discriminator and the generator is used to optimize the image.
9. The method according to claim 1, characterized in that: Introducing skip connections in the neural network model allows low-level features to be directly passed to high-level layers to achieve feature fusion.
10. The method according to claim 1, characterized in that A multi-task learning framework is used to simultaneously perform dark light enhancement and denoising training, and multiple output heads are set in the same network for dark light enhancement and denoising respectively.
