An improved Retinex-Net low-light and dark vision image enhancement method
By improving the Retinex-Net network, using dual-branch decomposition, three-branch light map adjustment and residual block plus dual-class U-Net structure, the problems of large reflection map noise and local overexposure in Retinex-Net are solved, achieving less noise and image enhancement that is more in line with human visual effects.
Patent Information
- Application Number
- CN202210161735.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-22
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-02-22
AI Technical Summary
The existing Retinex-Net low-light and dark vision image enhancement methods have problems such as large reflection image noise, local overexposure and overall noise, which affects visual effects and information acquisition.
Improved Retinex-Net network, using improved decomposition network, light map adjustment network and reflection map denoising network, through dual-branch decomposition, three-branch illumination map adjustment and residual block plus dual-class U-Net structure to reduce noise and improve image quality Brightness uniformity.
It reduces the noise in the enhanced image, improves the contrast and details of the image, is more in line with human visual effects, and reduces noise and overexposure.
Smart Images

Figure CN115018717B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of digital image processing, and in particular relates to an improved Retinex-Net low-illumination and dark vision image enhancement method. Background Art
[0002] In daily life, especially at night, due to weak light and uneven lighting, the captured images have low brightness, low contrast, and hidden image details, which restricts human subjective vision and affects people's acquisition of information in the image. At the same time, many advanced computer vision tasks, such as target detection, target classification, and target tracking, also rely on clear and high-contrast images to achieve high detection rates, classification rates, and tracking rates. Therefore, this places relatively high demands on image enhancement methods, so that low-light or dark vision images can be obtained through image enhancement methods. High-quality images.
[0003] There are many kinds of image enhancement algorithms developed so far, such as image enhancement methods based on mathematical functions, image enhancement methods based on histogram equalization, image fusion methods and methods based on Retinex theory. However, all of the above methods have some shortcomings. For example, although the image enhancement method based on mathematical functions is simple and convenient, it relies on artificially designed mathematical functions, and most of them are global operations, which can easily cause overexposure or underexposure. The image enhancement method based on histogram equalization can easily cause grayscale merging and loss of details. The image fusion method requires taking multiple images of the same scene, which is difficult to shoot, and artifacts are likely to appear after image fusion. The enhancement results based on Retinex theory rely heavily on carefully designed functions, so it is also easy to cause overexposure or underenhancement, and the generalization ability is poor.
[0004] Among the deep learning methods that have emerged in recent years, the more classic one is the deep learning network model based on the Retinex theory, Retinex-Net, which uses paired image data to learn the mapping function between low-light images and reference images. Because it does not rely on artificially designed functions, but is data-driven learning. Therefore, the enhanced image obtained has greatly improved in contrast, brightness, details, etc. compared with the enhanced image obtained by non-deep learning methods before, and is more in line with human subjective visual effects. However, because its decomposition network is relatively simple, the decomposed reflection map has a lot of noise. Moreover, after the illumination map is adjusted through the network, there is a phenomenon of overexposure in some areas. And the reflection map still has a lot of noise after being processed by BM3D. Therefore, some areas of the final enhanced image are overexposed and there are large noise points as a whole, which affects people's visual effects and the information obtained from the image. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention proposes an improved Retinex-Net low-light and dark vision image enhancement method. The method comprises: obtaining a low-light or dark vision image and preprocessing it, inputting the preprocessed low-light or dark vision image into an improved Retinex-Net network to obtain an enhanced image; wherein the improved Retinex-Net network comprises an improved decomposition network, an improved illumination map adjustment network and a reflectance map denoising network;
[0006] The improved Retinex-Net network processes low-light or dark vision images after preprocessing, including:
[0007] S1: Use the improved decomposition network to process the preprocessed low-light or dark vision image to obtain the reflectance map R of the low-light or dark vision image low and Light Map I low ;
[0008] S2: R low and I low Input into the improved light map adjustment network for processing to obtain the adjusted light map Will Make two copies and Stitching is performed to obtain the spliced illumination map
[0009] S3: R low Input into the reflection map denoising network to obtain the noise map N low , N low Make two copies and add them to the original N low Perform splicing to obtain the spliced noise map N low_concat According to R low and N low_concat , and get the denoised reflection map
[0010] S4: According to and Obtain enhanced images of low-light or dark vision images.
[0011] Preferably, the preprocessing process of the low illumination or dark vision image includes:
[0012] The low-light or dark vision image is divided to obtain the low-light or dark vision image in n areas; the image in the n areas is randomly rotated and flipped to obtain the pre-processed low-light or dark vision image; wherein n is an integer greater than 2 and less than the number of images.
[0013] Preferably, the process of processing low-light or dark vision images using the improved decomposition network includes:
[0014] Get the maximum value of each channel pixel in the low-light or dark vision image to get the feature map input_max;
[0015] Concatenate the low-light or dark vision image and input_max to obtain the feature map input_img.
[0016] Copy input_img and pass it through a convolution activation layer together with the original input_img to obtain feature conv1 and feature conv2;
[0017] Conv1 and Conv2 are respectively passed through five layers of convolution activation layers to obtain Conv1 and Conv2 after being processed by five layers of convolution activation layers;
[0018] According to conv1 and conv2, the feature map conv_avg is obtained;
[0019] Pass conv_avg through a convolution layer to get the final convolution result conv_out; use the Sigmoid function to process conv_out to get the reflection map R of the low-light or dark vision image. low and Light Map I low .
[0020] Preferably, the process of improving the light map adjustment network to process the reflection map and the light map includes:
[0021] Concatenate the reflection map and the illumination map to get the feature map input_im;
[0022] Input_im passes through three convolutional layers respectively to obtain the convolution results part1_conv5, part2_conv5 and part3_conv5; among them, the convolution kernel sizes in the three convolutional layers are 1, 3, and 5 respectively, the number of convolutional layers is 5, the first layer is a normal convolutional layer, and the last four layers are activated convolutional layers;
[0023] According to part1_conv5, part2_conv5 and part3_conv5, the feature map part_all_avg is obtained; part_all_avg is passed through a single-channel convolution layer to obtain the final convolution result output, which is the adjusted illumination map
[0024] Preferably, the reflection map denoising network processes the reflection map including:
[0025] The decomposed reflection map is input into the first convolution activation layer to obtain the first layer feature conv1; the first layer feature is input into the first average pooling layer to obtain the first pooling feature conv1_pool;
[0026] Input the first pooling feature conv1_pool to the second convolution activation layer to obtain the second layer feature conv2; input the second layer feature conv2 to the second average pooling layer to obtain the second pooling feature conv2_pool;
[0027] The second pooling feature conv2_pool is input to the third convolution activation layer to obtain the third layer feature conv3; the ResBlock block is used to extract the feature conv3 to obtain the feature conv3_res; the ConvBlock block is used to further extract the feature conv3_res to obtain the feature conv3_block; the feature conv3_block is input to the third average pooling layer to obtain the third pooling feature conv3_pool;
[0028] The third pooling feature conv3_pool is input to the fourth convolution activation layer to obtain the fourth layer feature conv4; the upsampling splicing layer is used to splice the third layer feature conv3 and the fourth layer feature conv4 to obtain the feature map up4;
[0029] The feature map up4 is input to the fifth convolution activation layer to obtain the fifth layer feature conv5; the upsampling splicing layer is used to splice the second layer feature conv2 and the fifth layer feature conv5 to obtain the feature map up5;
[0030] The feature map up5 is input to the sixth convolution activation layer to obtain the sixth layer feature conv6; the upsampling splicing layer is used to splice the first layer feature conv 1 and the sixth layer feature conv6 to obtain the feature map up6;
[0031] The feature map up6 is input into a convolution layer to obtain the convolution feature out_noise; the out_noise is processed by the Sigmoid function to obtain the noise map N low .
[0032] Furthermore, the process of extracting the features of the third layer conv3 using the ResBlock block includes: the ResBlock block includes a residual block and a convolution layer, wherein the residual block is composed of three convolution activation layers and an add layer;
[0033] The first convolution activation layer of the residual block is used to process conv3 to obtain the feature map res_block_conv1;
[0034] The second convolution activation layer of the residual block is used to process res_block_conv1 to obtain the feature map res_block_conv2;
[0035] The third convolution activation layer of the residual block is used to process res_block_conv2 to obtain the feature map res_block_conv3;
[0036] Use the add layer of the residual block to process conv3 and res_block_conv3 to obtain the feature map res_block_out;
[0037] The res_block_out is processed by a convolutional layer to obtain the feature conv3_res.
[0038] Furthermore, the process of using the ConvBlock block to further extract the feature conv3_res includes: the ConvBlock block includes a first convolution activation layer, a second convolution activation layer, a pooling layer implemented by convolution, and an upsampling splicing layer;
[0039] The first convolution activation layer is used to process conv3_res to obtain the feature map conv_block_conv1;
[0040] The pooling layer implemented by convolution is used to process conv_block_conv1 to obtain the feature map conv_block_avgPool;
[0041] The second convolution activation layer is used to process conv_block_avgPool to obtain the feature map conv_block_conv2;
[0042] The upsampling concatenation layer is used to process conv_block_conv1 and conv_block_conv2 to obtain the feature conv3_block.
[0043] Furthermore, the process of splicing the third-layer feature conv3 and the fourth-layer feature conv4 using the upsampling splicing layer includes: using neighborhood interpolation to expand the size of the fourth-layer feature conv4 to twice the original size; splicing the third-layer feature conv3 and the enlarged fourth-layer feature conv4 in the third dimension to obtain a feature map up4.
[0044] The beneficial effects of the present invention are as follows: in the decomposition network stage, a double-branch decomposition network is used to find the average value to replace the single-branch decomposition network in the original network, which can reduce the noise in the reflection map. In the illumination map adjustment network, a three-branch network is used to find the average value to replace the original network U-Net structure, which can adjust the image brightness and make the image brightness uniform to obtain an illumination map with appropriate exposure. In the reflection map denoising stage, a network structure is designed, namely a residual block plus a double-U-Net network structure. Through the residual block, the training process of the network can be accelerated, so that the network can converge to the optimal value faster. Through the U-Net-like downsampling, upsampling, and jump connection structure, shallow and deep features can be fused to obtain richer features, thereby better obtaining a noise map. Therefore, through the present invention, an enhanced image with less noise and more in line with the visual effects of the human eye can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flow chart of the improved Retinex-Net low-light and dark vision image enhancement method in the present invention;
[0046] Figure 2 This is a schematic diagram of the structure of the reflection image denoising network designed in the present invention;
[0047] Figure 3 This is a comparison chart of the enhancement effect of the present invention and the comparison method on the low-light LOL dataset image;
[0048] Figure 4 This is a comparison chart of the enhancement effect of the present invention and the comparison method on the low-light LIME dataset image;
[0049] Figure 5 This is a comparison diagram of the enhancement effect of the present invention and the comparison method on the artificially taken dark vision picture of the license plate. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] The present invention proposes an improved Retinex-Net low-light and dark vision image enhancement method, the method comprising: obtaining a low-light or dark vision image and preprocessing it, inputting the preprocessed low-light or dark vision image into an improved Retinex-Net network to obtain an enhanced image; wherein the improved Retinex-Net network comprises an improved decomposition network, an improved illumination map adjustment network and a reflectance map denoising network;
[0052] The improved Retinex-Net network processes low-light or dark vision images after preprocessing, including:
[0053] S1: Use the improved decomposition network to process the preprocessed low-light or dark vision image to obtain the reflectance map R of the low-light or dark vision image low and Light Map I low ;
[0054] S2: R low and I low Input into the improved light map adjustment network for processing to obtain the adjusted light map Will Make two copies and Stitching is performed to obtain the spliced illumination map
[0055] S3: R low Input into the reflection map denoising network to obtain the noise map N low , N low Make two copies and add them to the original N low Perform splicing to obtain the spliced noise map N low_concat According to R low and N low_concat , and get the denoised reflection map
[0056] S4: According to and Obtain enhanced images of low-light or dark vision images.
[0057] Obtain low-light or dark vision images and preprocess them. The preprocessing process is as follows:
[0058] Divide the low-light or dark vision image to obtain n areas of low-light or dark vision images; perform random rotation and flipping operations on the images in the n areas to obtain pre-processed low-light or dark vision images; where n is an integer greater than 2 and less than the number of images. For example: according to the image file path, read the images that need image enhancement, and the number of images sent to the improved Retinex-Net network for processing at one time is a batch, and multiple batches constitute an epoch. A batch of images can be divided into small patch areas. Before processing, perform random rotation, flipping and other operations on each small area for data enhancement to obtain a pre-processed low-light or dark vision image.
[0059] The specific parameters of each layer of the improved decomposition network of a preferred embodiment of the present invention are shown in Table 1.
[0060] Table 1 Specific parameters of each layer of the improved decomposition network
[0061]
[0062] The preferred embodiment of inputting the pre-processed low-light or dark vision image into the improved decomposition network for processing is as follows:
[0063] Get the pre-processed low-light or dark vision image (S low ) to obtain the maximum pixel value of each channel in the feature map input_max.
[0064] Concatenate the low-light or dark vision image and input_max in the third dimension to obtain the feature map input_img.
[0065] Copy the feature map input_img, input the first feature map input_img into the first convolution layer to obtain feature conv1; input the second feature map input_img into the second convolution layer to obtain feature conv2. Preferably, the convolution kernel size of the first convolution activation layer is 3×3, the step size is 1, the padding method is SAME, and the number is 64; the convolution kernel size of the second convolution activation layer is 9×9, the step size is 1, the padding method is SAME, and the number is 64.
[0066] Conv1 and conv2 are respectively passed through five convolution activation layers, where the output of each layer is the input of the next layer. After five layers of convolution activation processing, the processed conv1 and conv2 are obtained. Preferably, the convolution kernel size of the five convolution activation layers for processing conv1 is 1×1, the step size is 1, the padding method is SAME, the number is 64, and the activation function is Relu; the convolution kernel size of the five convolution activation layers for processing conv2 is 3×3, the step size is 1, the padding method is SAME, the number is 64, and the activation function is Relu.
[0067] After five layers of convolution activation, conv1 and conv2 are added pixel by pixel, and then the average is calculated to obtain the feature conv_avg.
[0068] Pass conv_avg through a convolution layer to obtain the feature conv_out. Preferably, the convolution kernel size is 3×3, the step size is 1, the padding method is SAME, and the number is 4.
[0069] The Sigmoid function is used to process the feature conv_out. Among the obtained features, the first three channels are reflection maps and the last channel is the illumination map.
[0070] The specific parameters of each layer of the improved illumination map adjustment network in a preferred embodiment of the present invention are shown in Table 2.
[0071] Table 2 Improved illumination map to adjust specific parameters of each layer of the network
[0072]
[0073] The reflection map R obtained by decomposing the improved decomposition network low and Light Map I low The preferred embodiment of the input to the improved light map adjustment network for processing is as follows:
[0074] Concatenate the reflection map and the illumination map in the third dimension to obtain the feature map input_im.
[0075] The adjustment network has 3 branches, each branch has a 5-layer convolution layer; input_im is sent to the first convolution layer of the first branch of the adjustment network to obtain the feature part1_conv1. Preferably, the convolution kernel size is 1×1, the step size is 1, the padding method is SAME, and the number is 32.
[0076] Send part1_conv1 to the second convolution activation layer of the first branch to obtain the feature part1_conv2. Preferably, the convolution kernel size is 1×1, the step size is 1, the padding method is SAME, the number is 64, and the activation function is Relu.
[0077] Send part1_conv2 to the third convolution activation layer of the first branch to obtain the feature part1_conv3. Preferably, the convolution kernel size is 1×1, the step size is 1, the padding method is SAME, the number is 128, and the activation function is Relu.
[0078] Send part1_conv3 to the fourth convolution activation layer of the first branch to obtain the feature part1_conv4. Preferably, the convolution kernel size is 1×1, the step size is 1, the padding method is SAME, the number is 64, and the activation function is Relu.
[0079] Send part1_conv4 to the fifth convolution activation layer of the first branch to obtain the feature part1_conv5. Preferably, the convolution kernel size is 1×1, the step size is 1, the padding method is SAME, the number is 32, and the activation function is Relu.
[0080] The difference between the other two branches and the first branch is that the convolution kernel size is 3×3 and 5×5 respectively. Other aspects are consistent with the first branch and will not be repeated here. After the five-layer convolution of the second and third branches, input_im obtains the features part2_conv5 and part3_conv5.
[0081] The features part1_conv5, part2_conv5 and part3_conv5 are added pixel by pixel to get the average value, and the feature part_all_avg is obtained.
[0082] Pass the feature part_all_avg through a convolutional layer to adjust the output of the network, that is, the adjusted illumination map. Preferably, the convolution kernel size is 3×3, the step size is 1, the padding method is SAME, and the number is 1.
[0083] By adopting the reflectance map denoising network designed by the present invention, the noise that may still remain after the decomposition stage is obtained from the reflectance map.
[0084] The specific parameters of each layer of the reflection image denoising network of a preferred embodiment of the present invention are shown in Table 3.
[0085] Table 3 Specific parameters of each layer of the designed reflection image denoising network
[0086]
[0087] like Figure 2 As shown, the decomposed reflection map R low A preferred embodiment of inputting to the reflectance map denoising network for processing is as follows:
[0088] The reflection map R low (input_img) is input into the first convolution activation layer to obtain the first layer feature conv1; the first layer feature is input into the first average pooling layer to obtain the first pooling feature conv1_pool, and the size of the first pooling feature conv1_pool is half of the first layer feature conv1; preferably, the convolution kernel size of the first convolution activation layer is 3×3, the step size is 1, the padding method is SAME, the number is 32, and the activation function is Relu; preferably, the pooling kernel size of the average pooling layer is 2×2, and the step size is 2.
[0089] The first pooling feature conv1_pool is input to the second convolution activation layer to obtain the second layer feature conv2; the second layer feature conv2 is input to the second average pooling layer to obtain the second pooling feature conv2_pool, and the size of the second pooling feature conv2_pool is half of the second layer feature conv2; preferably, the convolution kernel size of the second convolution activation layer is 3×3, the step size is 1, the padding method is SAME, the number is 64, and the activation function is Relu; preferably, the pooling kernel size of the average pooling layer is 2×2, and the step size is 2.
[0090] The second pooling feature conv2_pool is input to the third convolution activation layer to obtain the third layer feature conv3; the Resblock block is used to extract the feature conv3 to obtain the feature conv3_res; the ConvBlock block is used to further extract the feature conv3_res to obtain the feature conv3_block; the feature conv3_block is input to the third average pooling layer to obtain the third pooling feature conv3_pool, and the size of the third pooling feature conv3_pool is half of the feature conv3_block; preferably, the convolution kernel size of the third convolution activation layer is 3×3, the step size is 1, the filling method is SAME, the number is 128, and the activation function is Relu; preferably, the pooling kernel size of the average pooling layer is 2×2, and the step size is 2.
[0091] Preferably, the residual block size preserving layer ResBlock is composed of a residual block and a convolution layer of at least one convolution kernel, wherein the residual block is composed of 3 convolution activation layers and an add layer; preferably, the convolution kernel size of the residual block size preserving layer is 3×3, the step size is 1, the padding method is SAME, and the number is 128; the specific parameters of each layer of ResBlock in a preferred embodiment of the reflection image denoising network are shown in Table 4.
[0092] Table 4 Specific parameters of each layer of ResBlock
[0093]
[0094] The process of extracting features from the third layer feature conv3 using the residual block size preservation layer ResBlock includes:
[0095] The first convolution activation layer of the residual block is used to process conv3 to obtain the feature map res_block_conv1;
[0096] The second convolution activation layer of the residual block is used to process res_block_conv1 to obtain the feature map res_block_conv2;
[0097] The third convolution activation layer of the residual block is used to process res_block_conv2 to obtain the feature map res_block_conv3;
[0098] Use the add layer of the residual block to process conv3 and res_block_conv3 to obtain the feature map res_block_out;
[0099] The res_block_out is processed by a convolutional layer to obtain the feature conv3_res.
[0100] Preferably, the ConvBlock block includes a first convolution activation layer, a second convolution activation layer, a pooling layer and an upsampling splicing layer; the specific parameters of the ConvBlock block in a preferred embodiment of the reflection image denoising network are shown in Table 5.
[0101] Table 5 Specific parameters of each layer of ConvBlock
[0102]
[0103] The process of further feature extraction of feature conv3_res using ConvBlock block includes:
[0104] The first convolution activation layer is used to process conv3_res to obtain the feature map conv_block_conv1;
[0105] The pooling layer implemented by convolution is used to process conv_block_conv1 to obtain the feature map conv_block_avgPool;
[0106] The second convolution activation layer is used to process conv_block_avgPool to obtain the feature map conv_block_conv2;
[0107] The upsampling concatenation layer is used to process conv_block_conv1 and conv_block_conv2 to obtain the feature conv3_block.
[0108] The third pooling feature conv3_pool is input to the fourth convolution activation layer to obtain the fourth layer feature conv4; the upsampling splicing layer UpSample is used to splice the third layer feature conv3 and the fourth layer feature conv4 to obtain the feature map up4; preferably, the convolution kernel size of the fourth convolution activation layer is 3×3, the step size is 1, the filling method is SAME, the number is 128, and the activation function is Relu; with the third layer feature conv3 and the fourth layer feature conv4 as input, the specific parameters of each layer of UpSample in a preferred embodiment of the reflection image denoising network are shown in Table 6.
[0109] Table 6 Specific parameters of each layer of UpSample
[0110]
[0111] The process of using the upsampling splicing layer to splice the third-layer feature conv3 and the fourth-layer feature conv4 includes: using neighborhood interpolation to double the size of the fourth-layer feature conv4; splicing the third-layer feature conv3 and the enlarged fourth-layer feature conv4 in the third dimension, and inputting the spliced features into a convolution layer so that the number of feature channels becomes 64, thereby obtaining a feature map up4.
[0112] The feature map up4 is input into the fifth convolution activation layer to obtain the fifth layer feature conv5; the upsampling splicing layer UpSample is used to splice the second layer feature conv2 and the fifth layer feature conv5 to obtain the feature map up5 with 32 channels; the process of splicing operation using the upsampling splicing layer is the same as the above splicing steps, which will not be repeated here.
[0113] The feature map up5 is input into the sixth convolution activation layer to obtain the sixth layer feature conv6; the upsampling splicing layer is used to splice the first layer feature conv 1 and the sixth layer feature conv6 to obtain the feature map up6 with 32 channels; the process of splicing operation using the upsampling splicing layer is the same as the above splicing steps, which will not be repeated here.
[0114] The feature map up6 is input into a convolution layer to obtain the convolution feature out_noise; the out_noise is processed by the Sigmoid function to obtain the noise map N low ; Preferably, the convolution kernel size is 3×3, the step size is 1, the padding method is SAME, and the number is 1.
[0115] The noise map N in the reflection map is obtained from the reflection map adjustment network low , N low Make two copies and add them to the original N low Splice in the third dimension to get the spliced noise map N low_concat According to R low and N low_concat , and get the denoised reflection map according to and The final enhanced image is obtained, that is, the enhanced image of the low-light or dark vision image; the specific processing process is as follows:
[0116] R low Subtract N low_concat , and get the denoised reflection map The spliced light map With denoised reflection map Multiply pixel by pixel to get the final enhanced image
[0117] The improved Retinex-Net network is trained using low-light image datasets or artificially taken dark vision images; the low-light image dataset uses the LOL dataset (500 pairs of low-light and normal images) and the RAISE dataset (1000 pairs of low-light and normal images), and the training set, validation set, and test set are divided according to the ratio of 6:2:2; the dark vision training image pairs are artificially taken, totaling 100 pairs, and the training set, validation set, and test set are divided according to the ratio of 8:1:1. During training, the training set images are flipped, rotated, and other operations are performed to expand the number of training sets.
[0118] The total loss function of the improved decomposition network is:
[0119] loss decom =loss recon +λ ir loss ir +λ is loos is
[0120]
[0121] loss ir =‖R low -R normal ‖1
[0122]
[0123] Among them, loss decom To improve the total loss of the decomposition network, including the image reconstruction loss recon ,reflection Figure 1 Consistency loss ir and light map smoothing loss is , are calculated using the L1 norm; Represents the gradient, including The horizontal gradient and Vertical gradient; λ ir , is , ij represents the constant coefficient, R i Reflectance images representing low illumination, scotopic vision, or reference images; I i ,I j The illumination map representing low light, dark vision or reference image, R low Reflectance diagram for low light or dark vision, R normal represents the reflection map of the reference image, S j A reference image representing low light or dark vision; preferably, λ low,low , normal,normal are all 1, λ is=0.1,λ ir =0.01; g represents a constant coefficient, preferably, λ g Take the constant 10.
[0124] The total loss function of the improved and adjusted network is:
[0125] loss I_Adjust =loss recon +λ is loss is
[0126]
[0127]
[0128] Among them, loss I_Adjust Indicates the improvement of the total loss of the adjusted network, including the image reconstruction loss recon and light map smoothing loss is , are calculated using the L1 norm; λ is , g represents a constant coefficient; preferably, λ is is 3, λ g is 10; Represents the gradient, including The horizontal gradient and Vertical gradient; R low represents the decomposed reflection map, represents the adjusted light map, Indicates three splicing, S normal A reference image representing low-light, dark vision.
[0129] The total loss function of the reflection image denoising network is:
[0130] loss R_Noise_Remove =λ recon loss recon +λ ir loss ir
[0131]
[0132]
[0133] Among them, loss R_Noise_Remove Represents the total loss of the reflection image denoising network, including the image reconstruction loss recon and reflection Figure 1 Consistency loss ir, are calculated using the L1 norm; λ recon , ir represents a constant coefficient; preferably, λ recon is 3, λ ir =2; R low represents the decomposed reflection map, N low_concat represents the concatenation of the noise maps obtained from the reflection maps, Indicates three The splicing, represents the denoised reflectance map, R normal Represents the reflectance map of the reference image, S normal Reference images representing low-light or scotopic vision;
[0134] The present invention is evaluated and compared with the Retinex-Net method. The evaluation indicators used include peak signal-to-noise ratio (PSNR), image perception quality index (PI) and image naturalness evaluation index (NIQE). The comparison results of objective indicators between the Retinex-Net method and the present invention on low-illuminance and dark vision image datasets are shown in Tables 7 and 8.
[0135] Table 7 Comparison results of objective indicators between the Retinex-Net method and the present invention on low-light image dataset
[0136]
[0137] Table 8 Comparison results of objective indicators between the Retinex-Net method and the present invention on the dark vision image dataset
[0138]
[0139] It can be seen from Tables 7 and 8 that the present invention has a higher peak signal-to-noise ratio, indicating that the present invention can indeed reduce the noise in the enhanced image. In addition, the present invention also has lower PI and NIQE values, indicating that the enhanced image obtained by the present invention is more in line with human visual effects.
[0140] Comparison of the enhancement effects of the present invention and the Retinex-Net method on low-light LOL dataset images. Figure 3 As shown in the figure, (a) is the original image, (b) is the image enhanced by the Retinex-Net method, and (c) is the enhanced image obtained by the present invention; the enhancement effect of the present invention and the Retinex-Net method on the low-light LIME dataset image is compared. Figure 4 As shown in the figure, (a) is the original image, (b) is the image enhanced by the Retinex-Net method, and (c) is the enhanced image obtained by the present invention; the enhancement effect of the present invention and the Retinex-Net method on the artificial dark vision picture is compared. Figure 5 As shown, (a) is the original image, (b) is the image enhanced by the Retinex-Net method, and (c) is the enhanced image obtained by the present invention. By comparison, it can be clearly seen that compared with the Retinex-Net method, the enhanced image obtained by the present invention is clearer, has less noise, less distortion, and has obvious improvements in contrast, brightness, details, etc., which is more in line with human subjective visual effects.
[0141] In the decomposition network stage, the present invention adopts a double-branch decomposition network to find the average value to replace the single-branch decomposition network in the original network, which can reduce the noise in the reflection map. In the illumination map adjustment network, a three-branch network is used to find the average value to replace the original network U-Net structure, which can adjust the image brightness and make the image brightness uniform to obtain an illumination map with appropriate exposure. In the reflection map denoising stage, a network structure is designed, that is, a residual block plus a double-class U-Net network structure. Through the residual block, the training process of the network can be accelerated, so that the network converges to the optimal value faster. Through the structure of U-Net-like downsampling, upsampling, and jump connection, shallow and deep features can be fused to obtain richer features, thereby better obtaining a noise map. Therefore, through the present invention, an enhanced image with less noise and more in line with the visual effect of the human eye can be obtained.
[0142] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An improved Retinex-Net low-light and dark vision image enhancement method, characterized in that: include: Acquire a low-light or dark vision image and preprocess it, and input the preprocessed low-light or dark vision image into an improved Retinex-Net network to obtain an enhanced image; wherein the improved Retinex-Net network includes an improved decomposition network, an improved illumination map adjustment network, and a reflectance map denoising network; The process of improving the Retinex-Net network to process the pre-processed low-light or dark vision image includes: S1: Use the improved decomposition network to process the preprocessed low-light or dark vision image to obtain the reflectance map R of the low-light or dark vision image low and Light Map I low ; The process of processing low-light or dark vision images using an improved decomposition network includes: Get the maximum value of each channel pixel in the low-light or dark vision image to get the feature map input_max; Concatenate the low-light or dark vision image and input_max to obtain the feature map input_img; Copy input_img and pass it through a convolution activation layer together with the original input_img to obtain feature conv1 and feature conv2; Conv1 and Conv2 are respectively passed through five layers of convolution activation layers to obtain Conv1 and Conv2 after being processed by five layers of convolution activation layers; According to conv1 and conv2, the feature map conv_avg is obtained; Pass conv_avg through a convolution layer to get the final convolution result conv_out; use the Sigmoid function to process conv_out to get the reflection map R of the low-light or dark vision image. low and Light Map I low ; S2: R low and I low Input into the improved light map adjustment network for processing to obtain the adjusted light map Will Make two copies and Stitching is performed to obtain the spliced illumination map Improvements to the light map adjustment network's processing of reflection maps and light maps include: Concatenate the reflection map and the illumination map to get the feature map input_im; Input_im passes through three convolutional layers respectively to obtain the convolution results part1_conv5, part2_conv5 and part3_conv5; among them, the convolution kernel sizes in the three convolutional layers are 1, 3, and 5 respectively, the number of convolutional layers is 5, the first layer is a normal convolutional layer, and the last four layers are activated convolutional layers; According to part1_conv5, part2_conv5 and part3_conv5, the feature map part_all_avg is obtained; Pass part_all_avg through a single-channel convolution layer to get the final convolution result output, which is the adjusted illumination map S3: R low Input into the reflection map denoising network to obtain the noise map N low , N low Make two copies and add them to the original N low Perform splicing to obtain the spliced noise map N low_concat According to R low and N low_concat , and get the denoised reflection map The reflection map denoising network processes the reflection map in the following ways: Input the reflectance map of the low-light or dark vision image to the first convolution activation layer to obtain the first layer feature conv1; input the first layer feature to the first average pooling layer to obtain the first pooling feature conv1_pool; input the first pooling feature conv1_pool to the second convolution activation layer to obtain the second layer feature conv2; input the second layer feature conv2 to the second average pooling layer to obtain the second pooling feature conv2_pool; The second pooling feature conv2_pool is input to the third convolution activation layer to obtain the third layer feature conv3; the ResBlock block is first used to extract the feature conv3 to obtain the feature conv3_res; the ConvBlock block is then used to further extract the feature conv3_res obtained in the previous step to obtain the feature conv3_block; the feature conv3_block is input to the third average pooling layer to obtain the third pooling feature conv3_pool; The third pooling feature conv3_pool is input to the fourth convolution activation layer to obtain the fourth layer feature conv4; the upsampling splicing layer is used to splice the third layer feature conv3 and the fourth layer feature conv4 to obtain the feature map up4; The feature map up4 is input to the fifth convolution activation layer to obtain the fifth layer feature conv5; the upsampling splicing layer is used to splice the second layer feature conv2 and the fifth layer feature conv5 to obtain the feature map up5; The feature map up5 is input to the sixth convolution activation layer to obtain the sixth layer feature conv6; the upsampling splicing layer is used to splice the first layer feature conv 1 and the sixth layer feature conv6 to obtain the feature map up6; The feature map up6 is input into a convolution layer to obtain the convolution feature out_noise; the convolution feature out_noise is processed by the Sigmoid function to obtain the noise map N low ; S4: According to and Obtain enhanced images of low-light or dark vision images.
2. The improved Retinex-Net low-light and dark vision image enhancement method according to claim 1, characterized in that: The preprocessing process of the low-light or dark vision image includes: dividing the low-light or dark vision image to obtain the low-light or dark vision image in n areas; performing random rotation and flipping operations on the images in the n areas to obtain the preprocessed low-light or dark vision image; wherein n is an integer greater than 2 and less than the number of images.
3. The improved Retinex-Net low-light and dark vision image enhancement method according to claim 1, characterized in that: The process of extracting the third layer feature conv3 using the ResBlock block includes: the ResBlock block includes a residual block and a convolution layer, wherein the residual block is composed of 3 convolution activation layers and an add layer; The first convolution activation layer of the residual block is used to process conv3 to obtain the feature map res_block_conv1; The second convolution activation layer of the residual block is used to process res_block_conv1 to obtain the feature map res_block_conv2; The third convolution activation layer of the residual block is used to process res_block_conv2 to obtain the feature map res_block_conv3; Use the add layer of the residual block to process conv3 and res_block_conv3 to obtain the feature map res_block_out; The res_block_out is processed by a convolutional layer to obtain the feature conv3_res.
4. The improved Retinex-Net low-light and dark vision image enhancement method according to claim 1, characterized in that: The process of further extracting the feature conv3_res using the ConvBlock block includes: the ConvBlock block includes the first convolution activation layer, the second convolution activation layer, the pooling layer implemented by the convolution, and the upsampling splicing layer; The first convolution activation layer is used to process conv3_res to obtain the feature map conv_block_conv1; The pooling layer implemented by convolution is used to process conv_block_conv1 to obtain the feature map conv_block_avgPool; The second convolution activation layer is used to process conv_block_avgPool to obtain the feature map conv_block_conv2; The upsampling concatenation layer is used to process conv_block_conv1 and conv_block_conv2 to obtain the feature conv3_block.
5. The improved Retinex-Net low-light and dark vision image enhancement method according to claim 1, characterized in that: The process of splicing the third-layer feature conv3 and the fourth-layer feature conv4 using the upsampling splicing layer includes: using neighborhood interpolation to expand the size of the fourth-layer feature conv4 to twice the original size; splicing the third-layer feature conv3 and the enlarged fourth-layer feature conv4 in the third dimension, and then processing them through a convolution layer to obtain a feature map up4.
