# sRrsR-Net: A New Low-Light Image Enhancement Network via Raw Image Reconstruction
## 3 Methods
### Metadata Sampler and RGB-iRGB Modules  
In our approach with sRrsR-Net, in order to leverage the rich details of raw images, before performing low-light enhancement, it is necessary to convert the sRGB image to the raw format. However, generally, the raw image reconstruction is tailored to specific camera parameters and may lead to inaccurate reconstruction. Moreover, the incorporation of nonlinear operations, such as tone mapping, in the reconstruction process inevitably leads to information loss. Therefore, incorporating the key information of sRGB image  
Figure 2: Flowchart of sRrsR-Net integrating Sampler, RGB-iRGB, RAWFormer, and RRAW-sRGB modules.  
\(I\), named \(M\) (i.e., \(metadata(I)\)), into the raw reconstruction process is essential. Here, \(M\) represents metadata of one image which contain its key image-specific information. Inspired by [25], sRsRs-Net introduces the Sampler module to sample \(I\) to assist in raw image reconstruction. However, the joint training of the proposed Sampler consumes more computational resources. Therefore, in the sampling process, this study only adopts a max-pooling operation [29], a downsampling technique that reduces the spatial dimensions of input data while retaining the most salient features. By this simple sampling process, our method can maintain a balance between the desired effects and overall performance. Concretely, the sampling process of the Sampler module is initiated by inputting low-light image \(I\) into a max-pooling layer. The sampled metadata \(M\) of image \(I\) are computed as follows:  
\[M=MaxPooling(I) \tag{1}\]  
\(MaxPooling\) is a max-pooling method. Then, these features \(M\) are concatenated with the original low-light image \(I\) to obtain rich RGB intermediate feature maps of image \(I\).  
As shown in Figure 3, the RGB-iRGB module takes the concatenated data \(concat(I,\ M)\) as input, which is in the RGB three-channel format, and outputs the RGB intermediate feature map \(\hat{F}_{r}\), also in the RGB three-channel format. The process of this network can be mathematically expressed as follows:  
\[\hat{F}_{r}=f_{RGB-iRGB}(concat(I,\ M)) \tag{2}\]  
Here, \(f_{RGB-iRGB}\) is assumed to be a universal function for the RGB-iRGB module. Since there are significant changes in the arrangement of image pixels during the reconstruction process, to facilitate a smoother and more effective reconstruction, this intermediate feature map \(\hat{F}_{r}\) is introduced.  
As illustrated in Figure 3, the architecture of the RGB-iRGB network follows the U-Net framework. Firstly, the original input low-light image \(I\in R^{H\times W\times RGB}\) undergoes convolution to obtain low\(-\)level features \(F_{0}\in R^{H\times W\times C}\), where \(H\times W\) represents the feature map size, and \(C\) is the channel number. Following this, the downsampling operation will downsample \(F_{0}\) to obtain deeper features \(F_{d1}\in R^{\frac{H}{2}\times\frac{W}{2}\times 2C}\) and \(F_{d2}\in R^{\frac{H}{2}\times\frac{W}{2}\times 4C}\). In the final step, a combination of transposed convolution for upsampling and convolution operations is applied. This process increases the number of feature channels by half while simultaneously doubling the spatial dimensions of the feature map. The upsampling feature map is then passed through a \(3\times 3\) convolution, resulting in the final output feature map \(\hat{F}_{r}\in R^{H\times W\times RGB}\). The convolutional kernel size in the RGB-iRGB network is \(3\times 3\)  
Figure 3: The structure of the RGB-iRGB module.  
and downsampling is accomplished through max-pooling with a 2 \(\times\) 2 pooling kernel. Conversely, upsampling utilizes 2 \(\times\) 2 transposed convolution kernels.