# Low-Light Image Enhancement Algorithm Based on Deep Learning and Retinex Theory
## 2 Methods
### Image Decomposition Network  
The Retinex theory suggests that an image can be deconstructed into a reflectance component and an illumination component. The reflectance component encapsulates the inherent attributes of objects, remaining uninfluenced by external illumination. The images we encounter in our daily lives are the result of the fusion of the reflectance and illumination components. Therefore, the primary task of a low-light image enhancement algorithm based on the Retinex theory is to investigate how to separate the illumination map and reflectance map from the input image while preserving the details as much as possible.  
The specific structure of the image decomposition network module, as shown in Figure 2, aims to decompose the input low-light image into a smooth illumination map and reflectance map. To preserve the details as much as possible during the decomposition process, the decomposition module incorporates residual connections and introduces dilated convolution layers to increase the receptive field for better information gathering. The network structure of the decomposition module consists of two branches: the reflectance branch and the illumination branch. In the reflectance branch, the enhanced result of the dilated convolution is coupled with the output of the second convolutional layer. The coupled result is then coupled again with the result of the fourth convolutional layer. Multiple upsampling operations are performed to obtain the final reflectance map. In the illumination branch, the result after one coupling operation is combined with the output reflectance map. After a convolutional operation, the final illumination map is obtained.  
The loss function of the image decomposition module is designed as \(L_{dc}\), defined by Equation (1):  
\[L_{dc}=L_{rec}+\lambda_{rs}L_{rs}+\lambda_{is}L_{is} \tag{1}\]  
In the equation, \(\lambda_{rs}\) and \(\lambda_{is}\) are the coefficients balancing the consistency of the reflectance map and the smoothness of the illumination map. \(L_{rec}\) represents the reconstruction loss, ensuring the consistency between the decomposed reflectance map and the reconstructed image with the illumination map. \(L_{rs}\) denotes the loss function for the similarity reconstruction of the reflectance map, guaranteeing the consistency between the  
Figure 1: Algorithm framework diagram.  
Figure 2: Structure of image decomposition network.  
In Equation (7), \(I(x,y)\) represents the illumination map, \(A\) represents the relevant parameters of the adaptive curve, \(F(\cdot)\) represents the mapping process, and \(n\) represents the number of mappings.  
The illumination map enhancement module employs a composite form of the loss function \(J_{Enh}\). By adjusting the parameters of the mapping curve, the enhancement effect of the network is continually improved. The specific form of the loss function is given by Equation (8):  
\[J_{Enh}=\frac{1}{M}\sum_{i=1}^{N}\sum_{i=1}^{M}\lambda_{i}|F_{i-1}\cdot[I(x,y ),A_{i}(x,y)]\cdot R(x,y)-GT(x,y)| \tag{8}\]  
where \(M\) represents the number of image pixels, \(N\) represents the number of mappings, \(I(x,y)\) represents the illumination map, \(R(x,y)\) represents the reflectance map, \(GT(x,y)\) represents the reference image under normal lighting conditions, and \(F(\cdot)\) represents the process of mapping the illumination map.