A low-light image enhancement method based on multi-scale and contextual learning network
By constructing a multi-scale and context network MCL-Net, combined with multi-scale feature extraction and context encoding, the problem of CNN being difficult to capture multi-scale and global information is solved, adaptive low-light image enhancement is achieved, and the naturalness of the image is improved. and clarity.
Patent Information
- Application Number
- CN202210652706.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-07
- Publication Date
- 2024-09-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing CNN-based low-light image enhancement methods are difficult to capture multi-scale feature information and global information, resulting in under-enhancement or over-exposure in slightly darker or slightly brighter local areas.
Construct a multi-scale and context-based network MCL-Net. Through the multi-scale feature extraction module and context encoding sub-network, combined with the residual attention mechanism and Transformer, it learns rich local and global information to achieve adaptive low-light image enhancement.
It improves multi-scale feature representation capabilities and global vision, realizes adaptive low-light image enhancement, makes the enhancement effect more natural and clearer, and improves color saturation and diversity.
Smart Images

Figure CN114998145B
Abstract
Description
Technical Field
[0001] The invention relates to an image enhancement method, in particular to a low-illumination image enhancement method based on a multi-scale and context learning network. Background Art
[0002] Low-light image enhancement is an important and challenging task in computer vision. Images taken under dim or insufficient light conditions usually have problems such as low brightness, missing part of the image information, and a lot of noise, which seriously affect the image quality. Low-light image enhancement is to enhance the illumination, color, contrast, etc. of such images to make the images natural and clear. This task has been widely used in practical applications such as security monitoring, product inspection, human-computer interaction, medical applications, and target detection. In recent years, with the rapid development of convolutional neural networks, namely CNN, CNN has been widely used in computer vision tasks, among which CNN-based low-light enhancement methods have also been widely studied. In 2017, Lore et al. realized low-light enhancement by constructing a stacked sparse denoising autoencoder (LLNet), which was the first to show that deep learning is suitable for low-light enhancement tasks. In 2020, Syed et al. proposed a multi-scale residual module for key elements to extract background information from multiple scales while retaining high-resolution spatial details, achieving detail enhancement of low-light images. In 2021, EnlightenGAN designed by Jiang et al. was used for reference-free low-light image enhancement, reducing the reliance on paired (low-light-normal-light) datasets.
[0003] The above-mentioned CNN-based methods have achieved remarkable results, but such methods are limited by the size of the convolution kernel and are difficult to capture multi-scale feature information and global information. The defects are: on the one hand, from a local perspective, the illumination distribution of low-light images is complex, and its position, shape and size have a certain diversity. Therefore, it is difficult for a single-size convolution operation to fully learn the feature information of low-light distribution. On the other hand, from an overall perspective, the illumination of low-light images has a certain global style, such as being very dark overall or generally dark overall. Learning global information helps the model guide local illumination enhancement from a global perspective, and by capturing global and local information, the model has the ability of adaptive enhancement. Limited by the size of the convolution kernel receptive field, CNN is difficult to learn global contextual information, which makes it easy for such models to under-enhance slightly darker local areas or over-expose slightly brighter local areas. Summary of the invention
[0004] The purpose of the present invention is to provide a low-light image enhancement method based on multi-scale and context, so as to overcome the shortcomings of the prior art.
[0005] The technical solution of the present invention is to construct a network based on multiscale and context coding, namely Multiscaleand Context Learning Network, referred to as MCL-Net, by improving the multiscale feature representation ability of the model and learning the global vision, fully learning rich local and global information, so as to realize adaptive low-light image enhancement, the input of the network is a low-light image, and the output is its corresponding enhanced image; in order to extract multi-scale features, through four multi-scale feature extraction modules and three bilinear interpolation operations, jump connection, context coding and maximum pooling are integrated to construct a multi-scale feature learning sub-network; in order to obtain the global vision to guide the local illumination enhancement, a context coding sub-network implemented by a converter is constructed; in order to generate an enhancement result, an upsampling sub-network consisting of three groups of "up-sampling + feature splicing + multi-scale feature learning sub-networks" and a 1×1 convolution stack is constructed.
[0006] The present invention specifically comprises the following steps:
[0007] Step 1: Data collection and processing. The training dataset is 20,000 pairs of synthetic datasets. The original data is selected from the VOC and COCO datasets, and the test data LOL, NASA and LIME are used as test datasets.
[0008] Step 2, construct the MCL-Net network, a network model based on multi-scale and contextual learning, extract multi-scale features and context encoding information to enhance the network's ability to represent multi-scale information, and effectively learn the illumination distribution information through the residual attention mechanism (channel attention and spatial attention) to enhance the image's detail information and illumination.
[0009] The multi-scale learning module uses the maximum pooling operation with different step sizes to obtain multi-scale features, and then the features are sent to spatial attention and 3×3 convolution to filter noise information; when fusing multi-scale features, channel attention is introduced to weight different scale features, rather than simply treating information of each scale equally, so that the network can learn more valuable multi-scale information. This module can be expressed as:
[0010] F i =MS i (x)
[0011] MF=Fu(F1,F2)
[0012] Among them, MS(·) represents the maximum pooling, spatial attention, 3×3 convolution and upsampling operations, Fu(·) is a multi-scale feature fusion operation, including channel-based feature concatenation, 1×1 convolution, channel attention and pixel-by-pixel addition operations; in addition, the module also introduces 1×1 convolution and self-calibration convolution. 1×1 convolution is used to scale the channels of input and output features to reduce the amount of calculation; self-calibration convolution is used to capture local long-distance dependencies;
[0013] Step 3: In order to enable MCL-Net to obtain a global view to guide local illumination enhancement, a context encoding subnetwork implemented by Transformer is designed; Transformer is used to capture long-distance dependencies and is mainly composed of 1 image block embedding, 2 editors and 1 upsampling operation; the input features are first serialized by image block embedding, and then fused with position embedding and sent to the first editor. The input of the second editor consists of the output of the first editor and the position embedding. Finally, the serialized vector is converted into a two-dimensional feature map through the Reshape operation and sent to the upsampling operation to obtain the final output.
[0014] s3.1, Patch Embedding: It is used to divide the input features into several p*p patches and convert them into serialized vectors. First, the input features (C×H×W) are fed into the convolution operation H with a convolution kernel and a step size of p. conv get The features of H are then reshaped Resh and normalization operation H Norm Get the serialized vector It can be expressed as:
[0015]
[0016] s3.2, Encoder: Encoder is the core module of Transformer, which is used to capture long-distance dependencies between pixels. Each Encoder consists of two Transformer Encoders. The input of Transformer Encoder is first normalized, and then linearly transformed (w1, w2, w3) to obtain the key vector Key, query vector Query and value vector Value, and then sent to H MHSA , the input and H MHSA The output of H is added pixel by pixel and then fed into the feedforward network. Norm With H MLP , and then the input and the feedforward network H FFThe output of Transformer Encoder is added to get the final output of Transformer Encoder. Transformer Encoder can be expressed as:
[0017]
[0018] Among them, x,x pe is the input feature and position encoding information, H, W are the height and width of the feature map, i, j are the element subscripts of the feature map, and ⊕ is pixel-by-pixel addition;
[0019] In step 4, the output of the context encoding subnetwork and the output of the multi-scale subnetwork are used as the input of the upsampling subnetwork; finally, a 1×1 convolution is used to map the number of channels to the output channel to obtain the enhanced image.
[0020] In order to evaluate the image quality of low-light image enhancement, the image loss is considered from the aspects of image reconstruction global information, detail information and generated content. The present invention defines a polynomial loss function based on reconstruction loss, perceptual loss function and content generation to make up for the lack of generated image quality judgment criteria and guide the network to generate high-quality images. rec is the reconstruction loss, L per is the perceptual loss, where w rec =1,w per =0.006;
[0021] L ACE-VAE =w rec L rec +w per L per
[0022] The reconstruction loss is used to ensure that MCL-Net generates low-light enhanced images with complete structural content. Specifically, MSE is used to calculate the error between the MCL-Net output and the normal illumination image; as shown in the following formula, I gt is a normal illumination image, MCL-Net(·) is the MCL-Net network;
[0023]
[0024] MSE smoothes the noise in the image and also smoothes the detailed texture features, resulting in blurred images and easy artifacts. For this reason, perceptual loss is introduced to guide the network to retain more texture information and improve the quality of the enhanced image, as shown in the following formula:
[0025]
[0026] Among them, w ij ,h ij ,c ij is the size of each feature map in the MCL-Net network, represents the i-th convolutional module of the j-th convolutional group in MCL-Net, μ x ,μ y is the pixel mean, is the variance, σ xy is the covariance, C1 and C2 are constants.
[0027] The beneficial effect of the present invention is that the model can improve the multi-scale feature representation capability and learn the global vision, fully learn rich local and global information, thereby realizing adaptive low-light image enhancement, improving the color saturation and diversity while ensuring the image quality of the colorized result, enhancing the detail information of the low-light image, and making the low-light image enhancement effect more natural and clearer. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is the overall structure diagram of the network.
[0029] Figure 2 Learning subnetwork graphs for multi-scale features.
[0030] Figure 3 Encode subnetwork graph for context. DETAILED DESCRIPTION
[0031] The following is combined with Figures 1 to 3 The preferred embodiment of the present invention is further described, and a network based on multiscale and context coding, namely Multiscale and Context Learning Network, referred to as MCL-Net, is constructed. By improving the multiscale feature representation ability of the model and learning the global vision, rich local and global information is fully learned, thereby realizing adaptive low-light image enhancement. The input of the network is a low-light image, and the output is its corresponding enhanced image; in order to extract multiscale features, a multiscale feature learning subnetwork is constructed by integrating jump connection, context coding and maximum pooling through four multiscale feature extraction modules and three bilinear interpolation operations; in order to obtain the global vision to guide the local illumination enhancement, a context coding subnetwork implemented by a converter is constructed; in order to generate the enhancement result, an upsampling subnetwork composed of three groups of "upsampling + feature splicing + multiscale feature learning subnetwork" and a 1×1 convolution is constructed. That is, an upsampling subnetwork composed of three groups of "UP (upsamling) + concat + MF" and a Conv1*1 stack.
[0032] The present invention comprises the following steps:
[0033] Step 1: Data collection and processing. The training dataset is 20,000 pairs of synthetic datasets. The original data is selected from the VOC and COCO datasets, and the test data LOL, NASA and LIME are used as test datasets.
[0034] Step 2, construct the MCL-Net network, a network model based on multi-scale and contextual learning, extract multi-scale features and context encoding information to enhance the network's ability to represent multi-scale information, and effectively learn the illumination distribution information through the residual attention mechanism (channel attention and spatial attention) to enhance the image's detail information and illumination.
[0035] The multi-scale learning module uses the maximum pooling operation with different step sizes to obtain multi-scale features, and then the features are sent to spatial attention and 3×3 convolution to filter noise information; when fusing multi-scale features, channel attention is introduced to weight different scale features, rather than simply treating information of each scale equally, so that the network can learn more valuable multi-scale information. This module can be expressed as:
[0036] F i =MS i (x)
[0037] MF=Fu(F1,F2)
[0038] Among them, MS(·) represents the maximum pooling, spatial attention, 3×3 convolution and upsampling operations, Fu(·) is a multi-scale feature fusion operation, including channel-based feature concatenation, 1×1 convolution, channel attention and pixel-by-pixel addition operations; in addition, the module also introduces 1×1 convolution and self-calibration convolution. 1×1 convolution is used to scale the channels of input and output features to reduce the amount of calculation; self-calibration convolution is used to capture local long-distance dependencies;
[0039] Step 3: In order to enable MCL-Net to obtain a global view to guide local illumination enhancement, a context encoding subnetwork implemented by Transformer is designed;
[0040] Transformer is used to capture long-distance dependencies and is mainly composed of 1 image block embedding, 2 editors and 1 upsampling operation. The input features are first serialized by image block embedding, and then fused with position embedding and sent to the first encoder. The input of the second editor consists of the output of the first editor and the position embedding. Finally, the serialized vector is converted into a two-dimensional feature map through the Reshape operation and sent to the upsampling operation to obtain the final output.
[0041] s3.1, Patch Embedding: It is used to divide the input features into several p*p patches and convert them into serialized vectors. Figure 3 First, the input feature (C×H×W) is fed into the convolution operation H with both the convolution kernel and the step size p. conv get The features of H are then reshaped Resh and normalization operation H Norm Get the serialized vector It can be expressed as:
[0042]
[0043] s3.2, Encoder: Encoder is the core module of Transformer, which is used to capture long-distance dependencies between pixels. Each encoder consists of two Transformer Encoders. The input of Transformer Encoder is first normalized, and then linearly transformed (w1, w2, w3) to obtain the key vector Key, query vector Query and value vector Value, and then sent to H MHSA , the input and H MHSA The output of H is added pixel by pixel and then fed into the feedforward network. Norm With H MLP , and then the input and the feedforward network H FF The output of is added to get the final output of Transformer Encoder. Transformer Encoder can be expressed as:
[0044]
[0045] Among them, x,x pe is the input feature and position encoding information, H, W are the height and width of the feature map, i, j are the element subscripts of the feature map, and ⊕ is pixel-by-pixel addition;
[0046] In step 4, the output of the context encoding subnetwork and the output of the multi-scale subnetwork are used as the input of the upsampling subnetwork; finally, a 1×1 convolution is used to map the number of channels to the output channel to obtain the enhanced image.
[0047] In order to evaluate the image quality of low-light image enhancement, the image loss is considered from the aspects of image reconstruction global information, detail information and generated content. The present invention defines a polynomial loss function based on reconstruction loss, perceptual loss function and content generation to make up for the lack of generated image quality judgment criteria and guide the network to generate high-quality images. rec is the reconstruction loss, L per is the perceptual loss, where w rec =1,w per =0.006.
[0048] L ACE-VAE =w rec L rec +w per L per
[0049] The reconstruction loss is used to ensure that MCL-Net generates low-light enhanced images with complete structural content. Specifically, MSE is used to calculate the error between the MCL-Net output and the normal illumination image; as shown in the following formula, I gt is a normal illumination image, MCL-Net(·) is the MCL-Net network;
[0050]
[0051] MSE smoothes the noise in the image and also smoothes the detailed texture features, resulting in blurred images and easy artifacts. To this end, perceptual loss is introduced to guide the network to retain more texture information and improve the quality of the enhanced image, as shown in the following formula:
[0052]
[0053] Among them, w ij ,h ij ,c ij is the size of each feature map in the MCL-Net network, represents the i-th convolutional module of the j-th convolutional group in MCL-Net, μ x ,μ y is the pixel mean, is the variance, σ xy is the covariance, C1 and C2 are constants.
Claims
1. A low-light image enhancement method based on multi-scale and contextual learning network, characterized by: A network based on multiscale and context coding, namely Multiscale and Context Learning Network, referred to as MCL-Net, is constructed. By improving the multiscale feature representation ability of the model and learning the global vision, rich local and global information is fully learned to achieve adaptive low-light image enhancement. The input of the network is a low-light image, and the output is its corresponding enhanced image. In order to extract multi-scale features, a multi-scale feature learning sub-network is constructed through four multi-scale feature extraction modules and three bilinear interpolation operations, integrating jump connection, context coding and maximum pooling. In order to obtain the global vision to guide the local illumination enhancement, a context coding sub-network implemented by the converter is constructed. In order to generate the enhancement result, an upsampling sub-network consisting of three groups of "up-sampling + feature splicing + multi-scale feature learning sub-network" and a 1×1 convolution stack is constructed. The following steps are involved: Step 1: Build a network based on multi-scale and context coding. The network framework consists of a multi-scale feature learning subnetwork, a context coding subnetwork, and an upsampling subnetwork. MCL-Net is represented as: F img =H con (H ms (I ll )) I en =H up (F img ) Among them, H ms (·), H con (·) and H up (·) represent the multi-scale feature learning sub-network, context encoding sub-network and upsampling sub-network modules respectively; I ll and I en represents the low-light image and the image after illumination enhancement; F img Represents the output features of the multi-scale feature learning sub-network; Step 2: construct a core multi-scale learning module, which is constructed by combining the maximum pooling operation with different step sizes and the attention mechanism, so that it can enhance the network's ability to represent multi-scale information, thereby effectively learning illumination distribution information; The multi-scale learning module uses the maximum pooling operation with different step sizes to obtain multi-scale features, and then the features are sent to spatial attention and 3×3 convolution to filter out noise information; when fusing multi-scale features, channel attention is introduced to weight different scale features, rather than simply treating information of each scale equally, so that the network can learn more valuable multi-scale information; this module can be expressed as: F i =MS i (x) MF=Fu(F1,F2) Among them, MS(·) represents maximum pooling, spatial attention, 3×3 convolution and upsampling operations, Fu(·) is a multi-scale feature fusion operation, including channel-based feature concatenation, 1×1 convolution, channel attention and pixel-by-pixel addition operations; in addition, this module also introduces 1×1 convolution and self-calibration convolution; 1×1 convolution is used to scale the channels of input and output features to reduce the amount of calculation; self-calibration convolution is used to capture local long-distance dependencies; Step 3, in order to enable MCL-Net to obtain a global view to guide local illumination enhancement, a context encoding subnetwork implemented by Transformer is designed; the transformer is used to capture long-distance dependencies, mainly composed of 1 image block embedding, 2 editors and 1 upsampling operation; the input features are first processed by image block embedding serialization, and then fused with position embedding and sent to the first editor. The input of the second editor consists of the output of the first editor and the position embedding. Finally, the serialized vector is transformed into a two-dimensional feature map through a deformation operation and sent to the upsampling operation to obtain the final output; s3.1, PatchEmbedding: used to divide the input features into several p*p blocks and convert them into serialized vectors; first, the input feature C×H×W is sent to the convolution operation H with a convolution kernel and a step size of p. conv get The features are then transformed into H Resh and normalization operation H Norm Get the serialized vector F FE It can be expressed as: s3.2, Encoder: Encoder is the core module of the transformer, which is used to capture long-distance dependencies between pixels. Each Encoder consists of two Transformer Encoders. The input of the Transformer Encoder is first normalized, and then linearly transformed w1, w2, w3 to obtain the key vector Key, query vector Query and value vector Value, and then sent to H MHSA , the input and H MHSA The output of H is added pixel by pixel and then fed into the feedforward network. Norm With H MLP , and then the input and the feedforward network H FF The output of the transformer encoder is added to obtain the final output of the transformer editor; the transformer encoder can be expressed as: Among them, x,x pe is the input feature and position encoding information, H, W are the height and width of the feature map, i, j are the element subscripts of the feature map, It is pixel-by-pixel addition; In step 4, the output of the context encoding subnetwork and the intermediate output of the multi-scale subnetwork are used as the input of the upsampling subnetwork; finally, a 1×1 convolution is used to map the number of channels to the output channel to obtain the enhanced image.
2. The low-light image enhancement method based on multi-scale and contextual learning network according to claim 1, characterized in that: In order to evaluate the image quality of low-light image enhancement, the image loss is considered from the aspects of image reconstruction global information, detail information and generated content. A polynomial loss function based on reconstruction loss, perceptual loss function and content generation is defined to make up for the lack of generated image quality judgment criteria and guide the network to generate high-quality images. rec is the reconstruction loss, L per is the perceptual loss, where w rec =1,w per =0.006; L ACE-VAE =w rec L rec +w per L per The reconstruction loss is used to ensure that MCL-Net generates low-light enhanced images with complete structural content. Specifically, MSE is used to calculate the error between the MCL-Net output and the normal illumination image; as shown in the following formula, I gt is a normal illumination image, MCL-Net(·) is the MCL-Net network; MSE smoothes the noise in the image and also smoothes the detailed texture features, resulting in blurred images and easy artifacts. For this reason, perceptual loss is introduced to guide the network to retain more texture information and improve the quality of the enhanced image, as shown in the following formula: Among them, w ij ,h ij ,c ij is the size of each feature map in the MCL-Net network, Represents the i-th convolutional module of the j-th convolutional group in MCL-Net.
