Double-branch interactive perception weak light image enhancement method based on Retinex theory
Through the dual-branch interactive perception method based on Retinex theory, the illumination and reflection components of low-light images are extracted and fused, and the problems of serious details and noise in the prior art are solved, achieving higher quality image enhancement effects.
Patent Information
- Application Number
- CN202411160227.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-29
AI Technical Summary
The existing low-light image enhancement methods have problems with details loss and noise amplification, and the Retinex theory-based method lacks an effective fusion mechanism when dealing with light and reflected components, resulting in unsatisfactory enhancement effects.
Design a dual-branch interactive sensing low-light image enhancement method based on Retinex theory, extracting light and reflection components through the U-shaped decoupling network RUDN, adaptive feature extraction and denoising module AFDB removes noise, and light-aware self-attention module IAB perceives light information , and the fusion of lighting and reflection characteristics is achieved through the adaptive channel modulator ACM, combining the structure-aware full variation and perceived loss function, and dynamically adjust the loss weight.
Achieve higher quality image enhancement, maximize the preservation of details and authenticity, avoid details loss and noise amplification problems, and improve the visual effect of the image.
Smart Images

Figure CN119048379A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer digital image processing, and in particular relates to a dual-branch interactive perception low-light image enhancement method based on Retinex theory. Background Art
[0002] In practical applications, images taken in low-light environments usually have problems such as low brightness, poor contrast, high noise, and blurred details, which seriously degrades the visual quality of the images. These problems are particularly prominent in scenes such as night shooting, underground channel monitoring, and low-light laboratories. In order to improve the quality of images, low-light image enhancement technology has emerged. Low-light image enhancement aims to improve the brightness and contrast of images while reducing noise and retaining detail information.
[0003] At present, the low-light image enhancement methods based on deep learning mainly include the following categories: autoencoder-based methods, generative adversarial network (GAN)-based methods, convolutional neural network (CNN)-based methods, and Transformer-based methods. Although these methods have improved the quality of low-light images to a certain extent, there are still some shortcomings. For example, the enhanced image may have problems such as loss of details and noise amplification. In addition, the existing methods based on Retinex theory often lack an effective fusion mechanism when processing illumination and reflection components, resulting in unsatisfactory enhancement effects. Therefore, there is an urgent need for a new low-light image enhancement method that can better handle illumination and reflection components and achieve adaptive fusion, so as to obtain higher quality enhanced images. Summary of the invention
[0004] The purpose of the present invention is to provide a dual-branch interactive perception low-light image enhancement method based on Retinex theory, which solves the problems of detail loss and severe noise in the enhanced image existing in the prior art.
[0005] The technical solution adopted by the present invention is a dual-branch interactive perception low-light image enhancement method based on Retinex theory, which is specifically implemented according to the following steps:
[0006] Step 1: Design a U-shaped decoupling network RUDN based on Retinex theory to extract the illumination component L of the input low-light image low and the reflected component R low ;
[0007] Step 2: Design the adaptive feature extraction and denoising module AFDB to finally obtain the enhanced reflection component
[0008] Step 3: Design an adaptive channel modulator ACM;
[0009] Step 4: Design the illumination-aware self-attention module IAB to obtain the enhanced illumination component
[0010] Step 5: Build a complete neural network framework and train it;
[0011] Step 6: Test the neural network model saved in step 5 and output the enhanced image.
[0012] The present invention is also characterized in that:
[0013] Step 1 is implemented according to the following steps:
[0014] Step 1.1, first design the basic modules of the U-shaped decoupling network RUDN, each of which consists of 3 convolutional layers and an activation function; the basic module input first obtains preliminary features through 3 convolutional layers, and the preliminary features are further divided into two branches for processing. The first branch first deforms the preliminary features, that is, reshapes, and then performs matrix multiplication on the obtained features with the features of the second branch after 3 convolutional layers and reshape, and then passes through 3 convolutional layers in turn and performs residual connection with the initial input and preliminary features to obtain the final features of the basic module of this layer; the basic module uses the convolutional neural network CNN to obtain the refined features of the image, including edges, textures, and local contrast. These basic modules are used as the building blocks of each layer of the U-shaped decoupling network. The U-shaped decoupling network includes an encoder and a decoder, which are constructed through symmetrical three-layer downsampling and three-layer upsampling to construct a complete U-shaped decoupling network RUDN for deep decoupling of images;
[0015] Step 1.2: X the low-light image low Input U-shaped decoupling network RUDN, after deep decoupling of U-shaped decoupling network RUDN, the original low-light image X low is decomposed into the illumination component L low and the reflected component R low ; The decoupling process of the U-shaped decoupling network RUDN is shown in formula (1):
[0016] {L low ,R low}=RUDN(X low ),X low =L low ⊙R low (1)
[0017] Among them, RUDN() means using RUDN decoupling, and ⊙ represents element-by-element multiplication.
[0018] Step 2 is implemented as follows:
[0019] Step 2.1, the adaptive feature extraction and denoising module AFDB consists of two branches: the denoising branch consists of layer normalization, noise suppression attention module NSA and convolution layer and activation function cascade, and the feature extraction branch consists of three ConvNeXt modules, each of which is formed by convolution layer through residual connection; the final results obtained by the denoising branch and the feature extraction branch are input into the selective kernel feature fusion module SKFF for feature fusion to obtain the final output of a single AFDB module;
[0020] The denoising branch converts the reflection component R obtained in step 1 into low The initial feature extraction is performed through 3×3 convolution, and the extracted features are layer-normalized. The normalized features are then passed through the noise suppression attention module NSA, which adaptively removes the noise in the reflection component. The features after noise removal are residually connected with the original features, and then the processed features are layer-normalized again, and the features are further processed through multiple convolutional layers in sequence. Finally, the processed features are residually connected with the features before layer normalization. The final features and the features obtained by the feature extraction branch are input into the selective kernel feature fusion module SKFF for feature fusion. The denoising branch process is shown in formula (2):
[0021]
[0022] Among them, LN(·) is the layer normalization operation, R low is the reflection component of the input, NSA(·) is the adaptive denoising operation, X′ is the intermediate result of residual connection between the denoised feature and the original feature, and Y is the final feature obtained by residual connection between the processed feature and the feature before layer normalization;
[0023] Step 2.2: The feature extraction branch extracts the reflection component R obtained in step 1 low Deep feature extraction is performed through three cascaded ConvNeXt modules. The ConvNeXt module consists of 3×3 depth convolution, 1×1 convolution, GELU activation function and 1×1 convolution and is connected through residual connection. The feature extraction branch process is shown in formula (3):
[0024] Z = ConvNeXt 3 (R low ) (3)
[0025] Among them, ConvNeXt 3 () represents the sequence of three ConvNeXt modules, and Z is the final feature obtained after the three ConvNeXt modules;
[0026] Step 2.3: Input the final results obtained by the denoising branch and the feature extraction branch into SKFF for feature fusion. SKFF first sums feature Y and feature Z element by element, performs global average pooling on the summed features, and obtains features with smaller dimensions. The features with smaller dimensions are reduced in the channel dimension by 1×1 convolution and ReLU activation function. The reduced features are restored to the feature size after global average pooling and the softmax function is applied to obtain the attention activation feature. The activated features are then used to recalibrate the two input features. The final output fusion feature is the sum of the two features after calibration. The SKFF fusion process is shown in formula (4):
[0027]
[0028] Among them, f1 and f2 represent the final results of the denoising branch and the feature extraction branch respectively, and softmax(·) represents the use of the softmax function on the feature. represents matrix multiplication, represents the element-by-element summation, f R ′ is the final feature after SKFF fusion;
[0029] Step 2.4: Extract and optimize the features after processing by three cascaded AFDB modules through a 3×3 convolution to obtain the enhanced reflection component.
[0030] Step 3 is implemented as follows:
[0031] Step 3.1, Adaptive Channel Modulator ACM, composed of convolutional layers and softmax functions, is used to finely modulate the input features. ACM concatenates the features obtained by the three AFDB processes, and then sequentially performs 1×1 convolution and 3×3 convolution to separate the obtained features into two features along the channel dimension. The softmax function is applied to the first feature channel dimension and the result is element-wise multiplied with the concat feature, and then added to the second feature to obtain the selected feature. The calculation process is shown in formula (5):
[0032] ACM(AFDB1,AFDB2,AFDB3)=X concat ⊙softmax channel (Z1)+Z2 (5)
[0033] Where X concat =Concat[AFDB1,AFDB2,AFDB3], AFDB1, AFDB2 and AFDB3 are the features after processing by three cascaded AFDB modules, Z1, Z2 = Split(Conv 1×1(Conv 3×3 (X concat ), Split() means separation along the channel dimension, Z1 and Z2 represent two features separated along the channel dimension;
[0034] Step 3.2: Send the selected features to the illumination-aware self-attention block IAB in step 4.1, and participate in the calculation with the query Q in the attention mechanism.
[0035] Step 4 is implemented according to the following steps:
[0036] Step 4.1, the illumination-aware self-attention module IAB is used to extract features and calculate self-attention for the input illumination component. IAB consists of layer normalization, 1×1 convolutional layer and 3×3 convolutional layer connection, which is used to generate the query Q, key K, and value V projection in the attention mechanism. Specifically, the illumination component L obtained in step 1 is low The query Q, key K and value V in the attention are generated through layer normalization, 1×1 convolution and 3×3 convolution in sequence. Then, the feature obtained by ACM in step 3.2 is matrix multiplied with Q and passed through a softmax function. The result is combined with K and V to calculate the multi-head self-attention MSA. Finally, the features are further extracted through layer normalization, 1×1 convolution and 3×3 convolution in sequence. The whole process is shown in formula (6):
[0037]
[0038] Among them, Split() represents the split operation, F ACM is the characteristic of ACM output, Q′ is F ACM The result of interaction with Q, F IAB It is the output result of the current IAB module;
[0039] Step 4.2: The features processed by the three cascaded IAB modules are further extracted and optimized through a 3×3 convolution to obtain the enhanced illumination component.
[0040] Step 5 is implemented according to the following steps:
[0041] Step 5.1, the loss function consists of two parts, namely L RUDN , L Re , L RUDN Decomposition loss for RUDN, L Re is the reconstruction loss, and the total loss function is expressed as follows:
[0042] L total=αL RUDN +βL Re (7)
[0043] Among them, α and β are the decomposition loss L RUDN and the reconstruction loss L Re The weight of
[0044] Step 5.2: Calculate L RUDN , input RUDN decomposed illumination component L low and the reflected component R low , first calculate L low and R low The structure-aware total variation SATV is then used to calculate L RUDN ;
[0045] SATV(R low ,L low ) is calculated as follows:
[0046]
[0047] Among them, ω i,j is the structure-sensitive weight, the structure-aware weight ω i,j Defined as:
[0048]
[0049] Among them, g represents the gradient of the image, and λ is the adjustment parameter used to control the sensitivity of the weight;
[0050] L RUDN The calculation formula is as follows:
[0051]
[0052] Among them, ||·||1 represents the L1 norm, SATV(·,·) represents structure-aware total variation;
[0053] Step 5.3: Calculate L Re , input enhanced image and the reference image Y GT , L Re The definition is as follows:
[0054]
[0055] where ψ represents the network layer in the pre-trained VGG-19 network, ||·|| Perc represents the perceptual loss, which is formalized as:
[0056]
[0057] Among them, ψl Represents the l-th layer feature map of the VGG-19 network;
[0058] Step 5.4, select a GPU with 16GB video memory for training, use ADAM optimizer, set the initial learning rate to 0.01, adopt a multi-step decay strategy, and decay the learning rate at the 1000th, 2000th, 3000th and 4000th Epochs, each time decaying the learning rate by half. The entire training process lasts for 5000 Epochs;
[0059] Step 5.5: During the training process, regularly save the trained neural network parameters, the current number of training rounds Epoch, the status of the optimizer ADAM and the scheduler, and finally obtain the trained network model.
[0060] Step 6 is implemented according to the following steps:
[0061] Load the network model trained in step 5, input the low-light image to be tested into the trained network model, and then save the test results to obtain an enhanced image.
[0062] The beneficial effect of the present invention is that the dual-branch interactive perception low-light image enhancement method based on Retinex theory decomposes the input low-light image through the U-shaped decoupling network RUDN to extract the illumination component and the reflection component. The adaptive feature extraction and denoising module AFDB extracts the key features in the reflection component and removes the noise, and the illumination perception self-attention module IAB uses the Transformer to perceive the illumination information. Finally, the fusion of illumination and reflection features is achieved through the adaptive channel modulator (ACM). In addition, the loss function based on structure-aware total variation (SATV) and perceptual loss is used to adaptively adjust the loss weight to ensure the details and authenticity of the image enhancement, thereby achieving the best image enhancement effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 It is a schematic diagram of the overall structure of the dual-branch interactive perception low-light image enhancement method based on Retinex theory of the present invention;
[0064] Figure 2 It is a schematic diagram of the basic module structure of the U-shaped decoupling network RUDN of the dual-branch interactive perception low-light image enhancement method based on Retinex theory of the present invention;
[0065] Figure 3 It is a structural schematic diagram of the adaptive feature extraction and denoising module AFDB in the dual-branch interactive perception low-light image enhancement method based on Retinex theory of the present invention;
[0066] Figure 4It is a structural schematic diagram of the noise suppression module NSA of AFDB in the dual-branch interactive perception low-light image enhancement method based on Retinex theory of the present invention;
[0067] Figure 5 It is a structural schematic diagram of the selective kernel feature fusion module SKFF of AFDB in the dual-branch interactive perception low-light image enhancement method based on Retinex theory of the present invention;
[0068] Figure 6 It is a structural schematic diagram of the illumination perception sub-attention module IAB in the dual-branch interactive perception low-light image enhancement method based on Retinex theory of the present invention;
[0069] Figure 7 It is a structural schematic diagram of an adaptive channel modulator ACM in a dual-branch interactive sensing low-light image enhancement method based on Retinex theory of the present invention;
[0070] Figure 8 It is a schematic diagram of the effect of the dual-branch interactive perception low-light image enhancement method based on Retinex theory in the present invention in a low-light scene. DETAILED DESCRIPTION
[0071] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0072] The present invention is based on the dual-branch interactive perception low-light image enhancement method of Retinex theory, the flow chart is as follows Figure 1 As shown, the specific implementation steps are as follows:
[0073] Step 1: Design a U-shape decoupling network RUDN based on Retinex theory, namely Retinex-based U-shape Decoupling Net. According to Retinex theory, the input low-light image is deeply decoupled to extract the illumination component L of the input low-light image. low and the reflected component R low ;
[0074] Combination Figure 2 , step 1 is implemented according to the following steps:
[0075] Step 1.1, first design the basic modules of the U-shaped decoupling network RUDN. Each basic module consists of 3 convolutional layers and an activation function. The basic module input first obtains preliminary features through 3 convolutional layers. The preliminary features are further divided into two branches for processing. The first branch first deforms the preliminary features, that is, reshapes, and then performs matrix multiplication on the obtained features with the features of the second branch after 3 convolutional layers and reshape, and then passes through 3 convolutional layers in turn and performs residual connection with the initial input and preliminary features to obtain the final features of the basic module of this layer. The basic module uses the Convolutional Neural Network CNN, that is, Convolutional Neural Network The network obtains the refined features of the image, including edges, textures, and local contrast. These features are used to distinguish the illumination and reflection parts in the image. These basic modules are used as the building blocks of each layer of the U-shaped decoupling network. The U-shaped decoupling network includes an encoder and a decoder, which are constructed through three symmetrical layers of downsampling and upsampling. The encoder part gradually compresses the image information to extract high-level features, while the decoder part gradually restores the image to reconstruct the illumination and reflection components of the image. Finally, a complete U-shaped decoupling network RUDN is constructed for deep decoupling of images;
[0076] Step 1.2: X the low-light image low Input U-shaped decoupling network RUDN, after deep decoupling of U-shaped decoupling network RUDN, the original low-light image X low is decomposed into the illumination component L low and the reflected component R low ; The decoupling process of the U-shaped decoupling network RUDN is shown in formula (1):
[0077] {L low ,R low}=RUDN(X low ),X low =L low ⊙R low (1)
[0078] Among them, RUDN() means using RUDN decoupling, and ⊙ represents element-by-element multiplication.
[0079] Step 2: Design an adaptive feature extraction and denoising block (AFDB) to extract key features from the reflection component and remove unnecessary noise. The input reflection component is hierarchically encoded into multi-level features through three consecutive AFDBs. The obtained multi-level features are then sent to the adaptive channel modulator (ACM) to participate in the feature fusion of the illumination component, and finally the enhanced reflection component is obtained.
[0080] Combination Figure 3 , step 2 is implemented according to the following steps:
[0081] Step 2.1, the adaptive feature extraction and denoising module AFDB consists of two branches: the denoising branch consists of layer normalization, the noise suppression attention module NSA, and the convolution layer and the activation function cascade, and the feature extraction branch consists of three ConvNeXt modules, each of which is formed by a convolution layer through a residual connection; the final results obtained by the denoising branch and the feature extraction branch are input into the selective kernel feature fusion module SKFF, i.e. Selective Kernel Feature Fusion, for feature fusion to obtain the final output of a single AFDB module;
[0082] The denoising branch converts the reflection component R obtained in step 1 into low The initial feature extraction is performed through 3×3 convolution, and the extracted features are layer-normalized. The normalized features are then passed through the noise suppression attention module NSA, i.e., Noisy Suppression Attention, which adaptively removes the noise in the reflection component. The features after noise removal are residually connected with the original features, and then the processed features are layer-normalized again, and the features are further processed through multiple convolutional layers in sequence. Finally, the processed features are residually connected with the features before layer normalization. The final features and the features obtained by the feature extraction branch are input into the selective kernel feature fusion module SKFF, i.e., Selective Kernel Feature Fusion, for feature fusion. The denoising branch process is shown in formula (2):
[0083]
[0084] Among them, LN(·) is the layer normalization operation, R lowis the reflection component of the input, NSA(·) is the adaptive denoising operation, X′ is the intermediate result of residual connection between the denoised feature and the original feature, and Y is the final feature obtained by residual connection between the processed feature and the feature before layer normalization;
[0085] Step 2.2: The feature extraction branch extracts the reflection component R obtained in step 1 low Deep feature extraction is performed through three cascaded ConvNeXt modules. The ConvNeXt module consists of 3×3 depth convolution, 1×1 convolution, GELU activation function and 1×1 convolution and is connected through residual connection. The feature extraction branch process is shown in formula (3):
[0086] Z = ConvNeXt 3 (R low ) (3)
[0087] Among them, ConvNeXt 3 () represents the sequence of three ConvNeXt modules, and Z is the final feature obtained after the three ConvNeXt modules;
[0088] Step 2.3: Input the final results of the denoising branch and the feature extraction branch into SKFF, i.e. Selective Kernel Feature Fusion, for feature fusion. SKFF first sums feature Y and feature Z element by element, and performs global average pooling on the summed features to obtain features with smaller dimensions. The features with smaller dimensions are reduced in the channel dimension through 1×1 convolution and ReLU activation function. The reduced features are restored to the feature size after global average pooling and the softmax function is applied to obtain the attention activation feature. The activated features are then used to recalibrate the two input features. The final output fusion feature is the sum of the two features after calibration. The SKFF fusion process is shown in formula (4):
[0089]
[0090] Among them, f1 and f2 represent the final results of the denoising branch and the feature extraction branch respectively, and softmax(·) represents the use of the softmax function on the feature. represents matrix multiplication, represents the element-by-element summation, f R ′ is the final feature after SKFF fusion;
[0091] Step 2.4: Extract and optimize the features after processing by three cascaded AFDB modules through a 3×3 convolution to obtain the enhanced reflection component.
[0092] Step 3: Design an adaptive channel modulator (ACM), which modulates the multi-level features obtained by AFDB and sends them to the illumination-aware self-attention module (IAB) in step 4 to interact with the reflection component to avoid unnecessary detail loss.
[0093] Combination Figures 4 to 8 , step 3 is implemented according to the following steps:
[0094] Step 3.1, Adaptive Channel Modulator ACM, which consists of convolutional layers and softmax functions, is used to finely modulate the input features. ACM concatenates the features obtained by the three AFDB processes, i.e., concat, and then sequentially performs 1×1 convolution and 3×3 convolution to separate the obtained features into two features along the channel dimension. The softmax function is applied to the first feature channel dimension and the result is element-wise multiplied with the feature after concat, and then added to the second feature to obtain the selected feature. The calculation process is shown in formula (5):
[0095] ACM(AFDB1,AFDB2,AFDB3)=X concat ⊙softmax channel (Z1)+Z2 (5)
[0096] Where X concat =Concat[AFDB1,AFDB2,AFDB3], AFDB1, AFDB2 and AFDB3 are the features after processing by three cascaded AFDB modules, Z1, Z2 = Split(Conv 1×1 (Conv 3×3 (X concat ), Split() means separation along the channel dimension, Z1 and Z2 represent two features separated along the channel dimension;
[0097] Step 3.2: Send the selected features to the illumination-aware self-attention block IAB in step 4.1, and participate in the calculation with the query Q in the attention mechanism.
[0098] Step 4: Design an illumination-aware self-attention block IAB. By inputting the illumination component into three consecutive IABs, the long-range modeling capability of Transformer is used to perceive illumination information of different scales. Then, the illumination information of different scales is fused with the features obtained in the adaptive channel modulator ACM to finally obtain the enhanced illumination component.
[0099] Step 4 is implemented according to the following steps:
[0100] Step 4.1, the illumination-aware self-attention block IAB is used to extract features and calculate self-attention for the input illumination component. IAB consists of layer normalization, 1×1 convolutional layer and 3×3 convolutional layer, which is used to generate the query Q (Query), key K (Key), and value V (Value) projection in the attention mechanism. Specifically, the illumination component L obtained in step 1 is low The query Q, key K and value V in the attention are generated through layer normalization, 1×1 convolution and 3×3 convolution in sequence. Then, the feature obtained by ACM in step 3.2 is matrix multiplied with Q and passed through a softmax function. The result is combined with K and V to calculate the multi-head self-attention MSA, i.e. Multi-Self Attention. Finally, the features are further extracted through layer normalization, 1×1 convolution and 3×3 convolution in sequence. The whole process is shown in formula (6):
[0101]
[0102] Among them, Split() represents the split operation, F ACM is the characteristic of ACM output, Q′ is F ACM The result of interaction with Q, F IAB It is the output result of the current IAB module;
[0103] Step 4.2: The features processed by the three cascaded IAB modules are further extracted and optimized through a 3×3 convolution to obtain the enhanced illumination component.
[0104] Step 5: Use the modules designed in steps 1 to 4 to build a complete neural network framework, and design a loss function to guide the training process of the entire network to obtain a network that outputs the optimal enhanced image. Finally, train the built neural network for 5,000 epochs, verify the training results, and save the neural network model.
[0105] Step 5 is implemented according to the following steps:
[0106] Step 5.1, the loss function consists of two parts, namely L RUDN , L Re , L RUDN Decomposition loss for RUDN, L Re is the reconstruction loss, and the total loss function is expressed as follows:
[0107] L total =αL RUDN +βL Re (7)
[0108] Among them, α and β are the decomposition loss L RUDN and the reconstruction loss L Re The weight of
[0109] Step 5.2: Calculate L RUDN , input RUDN decomposed illumination component L low and the reflected component R low , first calculate L low and R low The structure-aware total variation SATV is then used to calculate L RUDN ;
[0110] SATV(R low ,L low ) is calculated as follows:
[0111]
[0112] Among them, ω i,j It is a structure-sensitive weight, which is calculated based on image gradient or other features. The structure-aware weight ω i,j Defined as:
[0113]
[0114] Among them, g represents the gradient of the image, and λ is the adjustment parameter used to control the sensitivity of the weight;
[0115] L RUDN The calculation formula is as follows:
[0116]
[0117] Among them, ||·||1 represents the L1 norm, SATV(·,·) represents structure-aware total variation;
[0118] Step 5.3: Calculate L Re , input enhanced image and the reference image Y GT , L Re The definition is as follows:
[0119]
[0120] where ψ represents the network layer in the pre-trained VGG-19 network, ||·|| Perc represents the perceptual loss, which measures the difference between generated images and real images in the VGG-19 feature space. The perceptual loss is formalized as:
[0121]
[0122] Among them, ψ l Represents the l-th layer feature map of the VGG-19 network;
[0123] Step 5.4, select a GPU with 16GB video memory for training, use ADAM optimizer, set the initial learning rate to 0.01, adopt a multi-step decay strategy, and decay the learning rate at the 1000th, 2000th, 3000th and 4000th Epochs, each time decaying the learning rate by half. The entire training process lasts for 5000 Epochs;
[0124] Step 5.5: During the training process, regularly save the trained neural network parameters, the current number of training rounds Epoch, the status of the optimizer ADAM and the scheduler, and finally obtain the trained network model.
[0125] Step 6: Test the neural network model saved in step 5 and output the enhanced image.
[0126] Step 6 is implemented according to the following steps:
[0127] Load the network model trained in step 5, input the low-light image to be tested into the trained network model, and then save the test results to obtain an enhanced image.
[0128] Example 1
[0129] The present invention is based on the dual-branch interactive perception low-light image enhancement method of Retinex theory, the flow chart is as follows Figure 1 As shown, the specific implementation steps are as follows:
[0130] Step 1: Design a U-shape decoupling network RUDN based on Retinex theory, namely Retinex-based U-shape Decoupling Net. According to Retinex theory, the input low-light image is deeply decoupled to extract the illumination component L of the input low-light image. low and the reflected component R low ;
[0131] Step 2: Design an adaptive feature extraction and denoising block (AFDB) to extract key features from the reflection component and remove unnecessary noise. The input reflection component is hierarchically encoded into multi-level features through three consecutive AFDBs. The obtained multi-level features are then sent to the adaptive channel modulator (ACM) to participate in the feature fusion of the illumination component, and finally the enhanced reflection component is obtained.
[0132] Step 3: Design an adaptive channel modulator (ACM), which modulates the multi-level features obtained by AFDB and sends them to the illumination-aware self-attention module (IAB) in step 4 to interact with the reflection component to avoid unnecessary detail loss.
[0133] Step 4: Design an illumination-aware self-attention block IAB. By inputting the illumination component into three consecutive IABs, the long-range modeling capability of Transformer is used to perceive illumination information of different scales. Then, the illumination information of different scales is fused with the features obtained in the adaptive channel modulator ACM to finally obtain the enhanced illumination component.
[0134] Step 5: Use the modules designed in steps 1 to 4 to build a complete neural network framework, and design a loss function to guide the training process of the entire network to obtain a network that outputs the optimal enhanced image. Finally, train the built neural network for 5,000 epochs, verify the training results, and save the neural network model.
[0135] Step 6: Test the neural network model saved in step 5 and output the enhanced image.
[0136] Example 2
[0137] The present invention is based on the dual-branch interactive perception low-light image enhancement method of Retinex theory, the flow chart is as follows Figure 1 As shown, the specific implementation steps are as follows:
[0138] Step 1: Design a U-shape decoupling network RUDN based on Retinex theory, namely Retinex-based U-shape Decoupling Net. According to Retinex theory, the input low-light image is deeply decoupled to extract the illumination component L of the input low-light image. low and the reflected component Rlow ;
[0139] Step 1 is implemented according to the following steps:
[0140] Step 1.1, first design the basic modules of the U-shaped decoupling network RUDN. Each basic module consists of 3 convolutional layers and an activation function. The basic module input first obtains preliminary features through 3 convolutional layers. The preliminary features are further divided into two branches for processing. The first branch first deforms the preliminary features, that is, reshapes, and then performs matrix multiplication on the obtained features with the features of the second branch after 3 convolutional layers and reshape, and then passes through 3 convolutional layers in turn and performs residual connection with the initial input and preliminary features to obtain the final features of the basic module of this layer. The basic module uses the Convolutional Neural Network CNN, that is, Convolutional Neural Network The network obtains the refined features of the image, including edges, textures, and local contrast. These features are used to distinguish the illumination and reflection parts in the image. These basic modules are used as the building blocks of each layer of the U-shaped decoupling network. The U-shaped decoupling network includes an encoder and a decoder, which are constructed through three symmetrical layers of downsampling and upsampling. The encoder part gradually compresses the image information to extract high-level features, while the decoder part gradually restores the image to reconstruct the illumination and reflection components of the image. Finally, a complete U-shaped decoupling network RUDN is constructed for deep decoupling of images;
[0141] Step 1.2: X the low-light image low Input U-shaped decoupling network RUDN, after deep decoupling of U-shaped decoupling network RUDN, the original low-light image X low is decomposed into the illumination component L low and the reflected component R low ; The decoupling process of the U-shaped decoupling network RUDN is shown in formula (1):
[0142] {L low ,R low}=RUDN(X low ),X low =L low ⊙R low (1)
[0143] Among them, RUDN() means using RUDN decoupling, and ⊙ represents element-by-element multiplication.
[0144] Step 2: Design an adaptive feature extraction and denoising block (AFDB) to extract key features from the reflection component and remove unnecessary noise. The input reflection component is hierarchically encoded into multi-level features through three consecutive AFDBs. The obtained multi-level features are then sent to the adaptive channel modulator (ACM) to participate in the feature fusion of the illumination component, and finally the enhanced reflection component is obtained.
[0145] Step 3: Design an adaptive channel modulator (ACM), which modulates the multi-level features obtained by AFDB and sends them to the illumination-aware self-attention module (IAB) in step 4 to interact with the reflection component to avoid unnecessary detail loss.
[0146] Step 3 is implemented as follows:
[0147] Step 3.1, Adaptive Channel Modulator ACM, which consists of convolutional layers and softmax functions, is used to finely modulate the input features. ACM concatenates the features obtained by the three AFDB processes, i.e., concat, and then sequentially performs 1×1 convolution and 3×3 convolution to separate the obtained features into two features along the channel dimension. The softmax function is applied to the first feature channel dimension and the result is element-wise multiplied with the feature after concat, and then added to the second feature to obtain the selected feature. The calculation process is shown in formula (5):
[0148] ACM(AFDB1,AFDB2,AFDB3)=X concat ⊙softmax channel (Z1)+Z2 (5)
[0149] Where X concat =Concat[AFDB1,AFDB2,AFDB3], AFDB1, AFDB2 and AFDB3 are the features after processing by three cascaded AFDB modules, Z1, Z2 = Split(Conv 1×1 (Conv 3×3 (X concat ), Split() means separation along the channel dimension, Z1 and Z2 represent two features separated along the channel dimension;
[0150] Step 3.2: Send the selected features to the illumination-aware self-attention block IAB in step 4.1, and participate in the calculation with the query Q in the attention mechanism.
[0151] Step 4: Design an illumination-aware self-attention block IAB. By inputting the illumination component into three consecutive IABs, the long-range modeling capability of Transformer is used to perceive illumination information of different scales. Then, the illumination information of different scales is fused with the features obtained in the adaptive channel modulator ACM to finally obtain the enhanced illumination component.
[0152] Step 4 is implemented according to the following steps:
[0153] Step 4.1, the illumination-aware self-attention block IAB is used to extract features and calculate self-attention for the input illumination component. IAB consists of layer normalization, 1×1 convolutional layer and 3×3 convolutional layer, which is used to generate the query Q (Query), key K (Key), and value V (Value) projection in the attention mechanism. Specifically, the illumination component L obtained in step 1 is low The query Q, key K and value V in the attention are generated through layer normalization, 1×1 convolution and 3×3 convolution in sequence. Then, the feature obtained by ACM in step 3.2 is matrix multiplied with Q and passed through a softmax function. The result is combined with K and V to calculate the multi-head self-attention MSA, i.e. Multi-Self Attention. Finally, the features are further extracted through layer normalization, 1×1 convolution and 3×3 convolution in sequence. The whole process is shown in formula (6):
[0154]
[0155] Among them, Split() represents the split operation, F ACM is the characteristic of ACM output, Q′ is F ACM The result of interaction with Q, F IAB It is the output result of the current IAB module;
[0156] Step 4.2: The features processed by the three cascaded IAB modules are further extracted and optimized through a 3×3 convolution to obtain the enhanced illumination component.
[0157] Step 5: Use the modules designed in steps 1 to 4 to build a complete neural network framework, and design a loss function to guide the training process of the entire network to obtain a network that outputs the optimal enhanced image. Finally, train the built neural network for 5,000 epochs, verify the training results, and save the neural network model.
[0158] Step 5 is implemented according to the following steps:
[0159] Step 5.1, the loss function consists of two parts, namely L RUDN , L Re , L RUDN Decomposition loss for RUDN, L Re is the reconstruction loss, and the total loss function is expressed as follows:
[0160] L total =αL RUDN +βL Re (7)
[0161] Among them, α and β are the decomposition loss L RUDN and the reconstruction loss L Re The weight of
[0162] Step 5.2: Calculate L RUDN , input RUDN decomposed illumination component L low and the reflected component R low , first calculate L low and R low The structure-aware total variation SATV is then used to calculate L RUDN ;
[0163] SATV(R low ,L low ) is calculated as follows:
[0164]
[0165] Among them, ω i,j It is a structure-sensitive weight, which is calculated based on image gradient or other features. The structure-aware weight ω i,j Defined as:
[0166]
[0167] Among them, g represents the gradient of the image, and λ is the adjustment parameter used to control the sensitivity of the weight;
[0168] L RUDN The calculation formula is as follows:
[0169]
[0170] Among them, ||·||1 represents the L1 norm, SATV(·,·) represents structure-aware total variation;
[0171] Step 5.3: Calculate L Re , input enhanced image and the reference image Y GT , L Re The definition is as follows:
[0172]
[0173] where ψ represents the network layer in the pre-trained VGG-19 network, ||·|| Perc represents the perceptual loss, which measures the difference between generated images and real images in the VGG-19 feature space. The perceptual loss is formalized as:
[0174]
[0175] Among them, ψ l Represents the l-th layer feature map of the VGG-19 network;
[0176] Step 5.4, select a GPU with 16GB video memory for training, use ADAM optimizer, set the initial learning rate to 0.01, adopt a multi-step decay strategy, and decay the learning rate at the 1000th, 2000th, 3000th and 4000th Epochs, each time decaying the learning rate by half. The entire training process lasts for 5000 Epochs;
[0177] Step 5.5: During the training process, regularly save the trained neural network parameters, the current number of training rounds Epoch, the status of the optimizer ADAM and the scheduler, and finally obtain the trained network model.
[0178] Step 6: Test the neural network model saved in step 5 and output the enhanced image.
[0179] Step 6 is implemented according to the following steps:
[0180] Load the network model trained in step 5, input the low-light image to be tested into the trained network model, and then save the test results to obtain an enhanced image.
[0181] Example 3
[0182] The present invention is based on the dual-branch interactive perception low-light image enhancement method of Retinex theory, the flow chart is as follows Figure 1 As shown, the specific implementation steps are as follows:
[0183] Step 1: Design a U-shape decoupling network RUDN based on Retinex theory, namely Retinex-based U-shape Decoupling Net. According to Retinex theory, the input low-light image is deeply decoupled to extract the illumination component L of the input low-light image. low and the reflected component R low ;
[0184] Step 1 is implemented according to the following steps:
[0185] Step 1.1, first design the basic modules of the U-shaped decoupling network RUDN. Each basic module consists of 3 convolutional layers and an activation function. The basic module input first obtains preliminary features through 3 convolutional layers. The preliminary features are further divided into two branches for processing. The first branch first deforms the preliminary features, that is, reshapes, and then performs matrix multiplication on the obtained features with the features of the second branch after 3 convolutional layers and reshape, and then passes through 3 convolutional layers in turn and performs residual connection with the initial input and preliminary features to obtain the final features of the basic module of this layer. The basic module uses the Convolutional Neural Network CNN, that is, Convolutional Neural Network The network obtains the refined features of the image, including edges, textures, and local contrast. These features are used to distinguish the illumination and reflection parts in the image. These basic modules are used as the building blocks of each layer of the U-shaped decoupling network. The U-shaped decoupling network includes an encoder and a decoder, which are constructed through three symmetrical layers of downsampling and upsampling. The encoder part gradually compresses the image information to extract high-level features, while the decoder part gradually restores the image to reconstruct the illumination and reflection components of the image. Finally, a complete U-shaped decoupling network RUDN is constructed for deep decoupling of images;
[0186] Step 1.2: X the low-light image low Input U-shaped decoupling network RUDN, after deep decoupling of U-shaped decoupling network RUDN, the original low-light image X low is decomposed into the illumination component L low and the reflected component R low ; The decoupling process of the U-shaped decoupling network RUDN is shown in formula (1):
[0187] {L low ,R low}=RUDN(X low ),X low =L low ⊙R low (1)
[0188] Among them, RUDN() means using RUDN decoupling, and ⊙ represents element-by-element multiplication.
[0189] Step 2: Design an adaptive feature extraction and denoising block (AFDB) to extract key features from the reflection component and remove unnecessary noise. The input reflection component is hierarchically encoded into multi-level features through three consecutive AFDBs. The obtained multi-level features are then sent to the adaptive channel modulator (ACM) to participate in the feature fusion of the illumination component, and finally the enhanced reflection component is obtained.
[0190] Step 2 is implemented as follows:
[0191] Step 2.1, the adaptive feature extraction and denoising module AFDB consists of two branches: the denoising branch consists of layer normalization, the noise suppression attention module NSA, and the convolution layer and the activation function cascade, and the feature extraction branch consists of three ConvNeXt modules, each of which is formed by a convolution layer through a residual connection; the final results obtained by the denoising branch and the feature extraction branch are input into the selective kernel feature fusion module SKFF, i.e. Selective Kernel Feature Fusion, for feature fusion to obtain the final output of a single AFDB module;
[0192] The denoising branch converts the reflection component R obtained in step 1 into low The initial feature extraction is performed through 3×3 convolution, and the extracted features are layer-normalized. The normalized features are then passed through the noise suppression attention module NSA, i.e., Noisy Suppression Attention, which adaptively removes the noise in the reflection component. The features after noise removal are residually connected with the original features, and then the processed features are layer-normalized again, and the features are further processed through multiple convolutional layers in sequence. Finally, the processed features are residually connected with the features before layer normalization. The final features and the features obtained by the feature extraction branch are input into the selective kernel feature fusion module SKFF, i.e., Selective Kernel Feature Fusion, for feature fusion. The denoising branch process is shown in formula (2):
[0193]
[0194] Among them, LN(·) is the layer normalization operation, R lowis the reflection component of the input, NSA(·) is the adaptive denoising operation, X′ is the intermediate result of residual connection between the denoised feature and the original feature, and Y is the final feature obtained by residual connection between the processed feature and the feature before layer normalization;
[0195] Step 2.2: The feature extraction branch extracts the reflection component R obtained in step 1 low Deep feature extraction is performed through three cascaded ConvNeXt modules. The ConvNeXt module consists of 3×3 depth convolution, 1×1 convolution, GELU activation function and 1×1 convolution and is connected through residual connection. The feature extraction branch process is shown in formula (3):
[0196] Z = ConvNeXt 3 (R low ) (3)
[0197] Among them, ConvNeXt 3 (·) represents the sequence of three ConvNeXt modules, and Z is the final feature obtained after the three ConvNeXt modules;
[0198] Step 2.3: Input the final results of the denoising branch and the feature extraction branch into SKFF, i.e. Selective Kernel Feature Fusion, for feature fusion. SKFF first sums feature Y and feature Z element by element, and performs global average pooling on the summed features to obtain features with smaller dimensions. The features with smaller dimensions are reduced in the channel dimension through 1×1 convolution and ReLU activation function. The reduced features are restored to the feature size after global average pooling and the softmax function is applied to obtain the attention activation feature. The activated features are then used to recalibrate the two input features. The final output fusion feature is the sum of the two features after calibration. The SKFF fusion process is shown in formula (4):
[0199]
[0200] Among them, f1 and f2 represent the final results of the denoising branch and the feature extraction branch respectively, and softmax(·) represents the use of the softmax function on the feature. represents matrix multiplication, represents the element-by-element summation, f R ′ is the final feature after SKFF fusion;
[0201] Step 2.4: Extract and optimize the features after processing by three cascaded AFDB modules through a 3×3 convolution to obtain the enhanced reflection component.
[0202] Step 3: Design an adaptive channel modulator (ACM), which modulates the multi-level features obtained by AFDB and sends them to the illumination-aware self-attention module (IAB) in step 4 to interact with the reflection component to avoid unnecessary detail loss.
[0203] Step 4: Design an illumination-aware self-attention block IAB. By inputting the illumination component into three consecutive IABs, the long-range modeling capability of Transformer is used to perceive illumination information of different scales. Then, the illumination information of different scales is fused with the features obtained in the adaptive channel modulator ACM to finally obtain the enhanced illumination component.
[0204] Step 4 is implemented according to the following steps:
[0205] Step 4.1, the illumination-aware self-attention block IAB is used to extract features and calculate self-attention for the input illumination component. IAB consists of layer normalization, 1×1 convolutional layer and 3×3 convolutional layer, which is used to generate the query Q (Query), key K (Key), and value V (Value) projection in the attention mechanism. Specifically, the illumination component L obtained in step 1 is low The query Q, key K and value V in the attention are generated through layer normalization, 1×1 convolution and 3×3 convolution in sequence. Then, the feature obtained by ACM in step 3.2 is matrix multiplied with Q and passed through a softmax function. The result is combined with K and V to calculate the multi-head self-attention MSA, i.e. Multi-Self Attention. Finally, the features are further extracted through layer normalization, 1×1 convolution and 3×3 convolution in sequence. The whole process is shown in formula (6):
[0206]
[0207] Among them, Split() represents the split operation, F ACM is the characteristic of ACM output, Q′ is F ACM The result of interaction with Q, F IAB It is the output result of the current IAB module;
[0208] Step 4.2: The features processed by the three cascaded IAB modules are further extracted and optimized through a 3×3 convolution to obtain the enhanced illumination component.
[0209] Step 5: Use the modules designed in steps 1 to 4 to build a complete neural network framework, and design a loss function to guide the training process of the entire network to obtain a network that outputs the optimal enhanced image. Finally, train the built neural network for 5,000 epochs, verify the training results, and save the neural network model.
[0210] Step 5 is implemented according to the following steps:
[0211] Step 5.1, the loss function consists of two parts, namely L RUDN , L Re , L RUDN Decomposition loss for RUDN, L Re is the reconstruction loss, and the total loss function is expressed as follows:
[0212] L total =αL RUDN +βL Re (7)
[0213] Among them, α and β are the decomposition loss L RUDN and the reconstruction loss L Re The weight of
[0214] Step 5.2: Calculate L RUDN , input RUDN decomposed illumination component L low and the reflected component R low , first calculate L low and R low The structure-aware total variation SATV is then used to calculate L RUDN ;
[0215] SATV(R low ,L low ) is calculated as follows:
[0216]
[0217] Among them, ω i,j It is a structure-sensitive weight, which is calculated based on image gradient or other features. The structure-aware weight ω i,j Defined as:
[0218]
[0219] Among them, g represents the gradient of the image, and λ is the adjustment parameter used to control the sensitivity of the weight;
[0220] L RUDN The calculation formula is as follows:
[0221]
[0222] Among them, ||·||1 represents the L1 norm, SATV(·,·) represents structure-aware total variation;
[0223] Step 5.3: Calculate L Re , input enhanced image and the reference image Y GT , L Re The definition is as follows:
[0224]
[0225] where ψ represents the network layer in the pre-trained VGG-19 network, ||·|| Perc represents the perceptual loss, which measures the difference between generated images and real images in the VGG-19 feature space. The perceptual loss is formalized as:
[0226]
[0227] Among them, ψ l Represents the l-th layer feature map of the VGG-19 network;
[0228] Step 5.4, select a GPU with 16GB video memory for training, use ADAM optimizer, set the initial learning rate to 0.01, adopt a multi-step decay strategy, and decay the learning rate at the 1000th, 2000th, 3000th and 4000th Epochs, each time decaying the learning rate by half. The entire training process lasts for 5000 Epochs;
[0229] Step 5.5: During the training process, regularly save the trained neural network parameters, the current number of training rounds Epoch, the status of the optimizer ADAM and the scheduler, and finally obtain the trained network model.
[0230] Step 6: Test the neural network model saved in step 5 and output the enhanced image.
[0231] Step 6 is implemented according to the following steps:
[0232] Load the network model trained in step 5, input the low-light image to be tested into the trained network model, and then save the test results to obtain an enhanced image.
[0233] like Figure 1As shown, an embodiment of the present invention includes: a dual-branch interactive perception low-light image enhancement method based on Retinex theory, using an adaptive feature extraction and denoising module AFDB to extract key features in the reflection component and remove unnecessary noise, using an illumination perception self-attention module IAB to perceive illumination information of different scales, and using an adaptive channel modulator ACM to interactively fuse reflection information and illumination information together, thereby retaining local features and global representation to the maximum extent, using element-by-element multiplication for image reconstruction, and being able to accurately utilize illumination components and reflection components to achieve low-light image enhancement, and finally using a carefully designed loss function to dynamically adjust the weights of the loss function to constrain the network to achieve the optimal enhancement effect.
[0234] The present invention is based on a dual-branch interactive perception low-light image enhancement method based on Retinex theory. The input low-light image is decomposed by a U-shaped decoupling network RUDN to extract the illumination component and the reflection component. The adaptive feature extraction and denoising module AFDB extracts the key features in the reflection component and removes the noise, and the illumination perception self-attention module IAB uses Transformer to perceive the illumination information. Finally, the fusion of illumination and reflection features is achieved through an adaptive channel modulator (ACM). In addition, a loss function based on structure-aware total variation (SATV) and perceptual loss is used to adaptively adjust the loss weights to ensure the details and authenticity of the image enhancement, thereby achieving the best image enhancement effect. An enhanced image is obtained from a low-light image, and the enhanced image has richer detail visibility, which has certain practical significance.
Claims
1. A dual-branch interactive perception low-light image enhancement method based on Retinex theory, characterized in that: Follow the steps below to implement it: Step 1: Design a U-shaped decoupling network RUDN based on Retinex theory to extract the illumination component L of the input low-light image low and the reflected component R low ; Step 2: Design the adaptive feature extraction and denoising module AFDB to finally obtain the enhanced reflection component Step 3: Design an adaptive channel modulator ACM; Step 4: Design the illumination-aware self-attention module IAB to obtain the enhanced illumination component Step 5: Build a complete neural network framework and train it; Step 6: Test the neural network model saved in step 5 and output the enhanced image.
2. The dual-branch interactive perception low-light image enhancement method based on Retinex theory according to claim 1 is characterized in that: The step 1 is specifically implemented according to the following steps: Step 1.1, first design the basic modules of the U-shaped decoupling network RUDN, each of which consists of 3 convolutional layers and an activation function; the basic module input first obtains preliminary features through 3 convolutional layers, and the preliminary features are further divided into two branches for processing. The first branch first deforms the preliminary features, that is, reshapes, and then performs matrix multiplication on the obtained features with the features of the second branch after 3 convolutional layers and reshape, and then passes through 3 convolutional layers in turn and performs residual connection with the initial input and preliminary features to obtain the final features of the basic module of this layer; the basic module uses the convolutional neural network CNN to obtain the refined features of the image, including edges, textures, and local contrast. These basic modules are used as the building blocks of each layer of the U-shaped decoupling network. The U-shaped decoupling network includes an encoder and a decoder, which are constructed through symmetrical three-layer downsampling and three-layer upsampling to construct a complete U-shaped decoupling network RUDN for deep decoupling of images; Step 1.2: X the low-light image low Input U-shaped decoupling network RUDN, after deep decoupling of U-shaped decoupling network RUDN, the original low-light image X low is decomposed into the illumination component L low and the reflected component R low ; The decoupling process of the U-shaped decoupling network RUDN is shown in formula (1): {L low ,R low }=RUDN(X low ),X low =L low ⊙R low (1) Among them, RUDN() means using RUDN decoupling, and ⊙ represents element-by-element multiplication.
3. The dual-branch interactive perception low-light image enhancement method based on Retinex theory according to claim 2 is characterized in that: The step 2 is specifically implemented according to the following steps: Step 2.1, the adaptive feature extraction and denoising module AFDB consists of two branches: the denoising branch consists of layer normalization, noise suppression attention module NSA and convolution layer and activation function cascade, and the feature extraction branch consists of three ConvNeXt modules, each of which is formed by convolution layer through residual connection; the final results obtained by the denoising branch and the feature extraction branch are input into the selective kernel feature fusion module SKFF for feature fusion to obtain the final output of a single AFDB module; The denoising branch converts the reflection component R obtained in step 1 into low The initial feature extraction is performed through 3×3 convolution, and the extracted features are layer-normalized. The normalized features are then passed through the noise suppression attention module NSA, which adaptively removes the noise in the reflection component. The features after noise removal are residually connected with the original features, and then the processed features are layer-normalized again, and the features are further processed through multiple convolutional layers in sequence. Finally, the processed features are residually connected with the features before layer normalization. The final features and the features obtained by the feature extraction branch are input into the selective kernel feature fusion module SKFF for feature fusion. The denoising branch process is shown in formula (2): Among them, LN(·) is the layer normalization operation, R low is the reflection component of the input, NSA(·) is the adaptive denoising operation, X′ is the intermediate result of residual connection between the denoised feature and the original feature, and Y is the final feature obtained by residual connection between the processed feature and the feature before layer normalization; Step 2.2: The feature extraction branch extracts the reflection component R obtained in step 1 low Deep feature extraction is performed through three cascaded ConvNeXt modules. The ConvNeXt module consists of 3×3 depth convolution, 1×1 convolution, GELU activation function and 1×1 convolution and is connected through residual connection. The feature extraction branch process is shown in formula (3): Z=ConvNeXt 3 (R low ) (3) Among them, ConvNeXt 3 () represents the sequence of three ConvNeXt modules, and Z is the final feature obtained after the three ConvNeXt modules; Step 2.3: Input the final results obtained by the denoising branch and the feature extraction branch into SKFF for feature fusion. SKFF first sums feature Y and feature Z element by element, performs global average pooling on the summed features, and obtains features with smaller dimensions. The features with smaller dimensions are reduced in the channel dimension by 1×1 convolution and ReLU activation function. The reduced features are restored to the feature size after global average pooling and the softmax function is applied to obtain the attention activation feature. The activated features are then used to recalibrate the two input features. The final output fusion feature is the sum of the two features after calibration. The SKFF fusion process is shown in formula (4): Among them, f1 and f2 represent the final results of the denoising branch and the feature extraction branch respectively, and softmax(·) represents the use of the softmax function on the feature. represents matrix multiplication, represents the element-by-element summation, f R ′ is the final feature after SKFF fusion; Step 2.4: Extract and optimize the features after processing by three cascaded AFDB modules through a 3×3 convolution to obtain the enhanced reflection component.
4. The dual-branch interactive perception low-light image enhancement method based on Retinex theory according to claim 3 is characterized in that: The step 3 is specifically implemented according to the following steps: Step 3.1, Adaptive Channel Modulator ACM, composed of convolutional layers and softmax functions, is used to finely modulate the input features. ACM concatenates the features obtained by the three AFDB processes, and then sequentially performs 1×1 convolution and 3×3 convolution to separate the obtained features into two features along the channel dimension. The softmax function is applied to the first feature channel dimension and the result is element-wise multiplied with the concat feature, and then added to the second feature to obtain the selected feature. The calculation process is shown in formula (5): ACM(AFDB1,AFDB2,AFDB3)=X c oncat⊙softmax channel (Z1)+Z2 (5) Where X concat =Concat[AFDB1,AFDB2,AFDB3], AFDB1, AFDB2 and AFDB3 are the features after processing by three cascaded AFDB modules, Z1, Z2 = Split(Conv 1×1 (Conv 3×3 (X concat ), Split() means separation along the channel dimension, Z1 and Z2 represent two features separated along the channel dimension; Step 3.2: Send the selected features to the illumination-aware self-attention block IAB in step 4.1, and participate in the calculation with the query Q in the attention mechanism.
5. The dual-branch interactive perception low-light image enhancement method based on Retinex theory according to claim 4 is characterized in that: The step 4 is specifically implemented according to the following steps: Step 4.1, the illumination-aware self-attention module IAB is used to extract features and calculate self-attention for the input illumination component. IAB consists of layer normalization, 1×1 convolutional layer and 3×3 convolutional layer connection, which is used to generate the query Q, key K, and value V projection in the attention mechanism. Specifically, the illumination component L obtained in step 1 is low The query Q, key K and value V in the attention are generated through layer normalization, 1×1 convolution and 3×3 convolution in sequence. Then, the feature obtained by ACM in step 3.2 is matrix multiplied with Q and passed through a softmax function. The result is combined with K and V to calculate the multi-head self-attention MSA. Finally, the features are further extracted through layer normalization, 1×1 convolution and 3×3 convolution in sequence. The whole process is shown in formula (6): Among them, Split() represents the split operation, F ACM is the feature of ACM output, Q′ is F ACM The result of interaction with Q, F IAB It is the output result of the current IAB module; Step 4.2: The features processed by the three cascaded IAB modules are further extracted and optimized through a 3×3 convolution to obtain the enhanced illumination component.
6. The dual-branch interactive perception low-light image enhancement method based on Retinex theory according to claim 5 is characterized in that: The step 5 is specifically implemented according to the following steps: Step 5.1, the loss function consists of two parts, namely L RUDN , L Re , L RUDN Decomposition loss for RUDN, L Re is the reconstruction loss, and the total loss function is expressed as follows: L total =αL RUDN +βL Re (7) Among them, α and β are the decomposition loss L RUDN and the reconstruction loss L Re The weight of Step 5.2: Calculate L RUDN , input RUDN decomposed illumination component L low and the reflected component R low , first calculate L low and R low The structure-aware total variation SATV is then used to calculate L RUDN ; SATV(R low ,L low ) is calculated as follows: Among them, ω i,j is the structure-sensitive weight, the structure-aware weight ω i,j Defined as: Among them, g represents the gradient of the image, and λ is the adjustment parameter used to control the sensitivity of the weight; L RUDN The calculation formula is as follows: Among them, ||·||1 represents the L1 norm, SATV(·,·) represents structure-aware total variation; Step 5.3: Calculate L Re , input enhanced image and the reference image Y GT , L Re The definition is as follows: where ψ represents the network layer in the pre-trained VGG-19 network, ||·|| Perc represents the perceptual loss, which is formalized as: Among them, ψ l Represents the l-th layer feature map of the VGG-19 network; Step 5.4, select a GPU with 16GB video memory for training, use ADAM optimizer, set the initial learning rate to 0.01, adopt a multi-step decay strategy, and decay the learning rate at the 1000th, 2000th, 3000th and 4000th Epochs, each time decaying the learning rate by half. The entire training process lasts for 5000 Epochs; Step 5.5: During the training process, regularly save the trained neural network parameters, the current number of training rounds Epoch, the status of the optimizer ADAM and the scheduler, and finally obtain the trained network model.
7. The dual-branch interactive perception low-light image enhancement method based on Retinex theory according to claim 6 is characterized in that: The step 6 is specifically implemented according to the following steps: Load the network model trained in step 5, input the low-light image to be tested into the trained network model, and then save the test results to obtain an enhanced image.
Citation Information
Cited By
Road condition monitoring method and system under complex light based on lightweight enhanced network
CN119888647A
