# Unsupervised Low-Light Image Enhancement in the Fourier Transform Domain
## 3 Proposed Method
### Loss Function  
(1) Adversarial loss  
The generator wants to be able to generate an image that will fool the discriminator, and the discriminator wants to be able to correctly identify whether the image is a fake image generated by the generator or a non-generated true image. In CycleGAN [19], because there are two generators and two discriminators, there are two adversarial losses--the adversarial losses of generator \(G_{1}\) and discriminator \(D_{1}\), and the adversarial losses of generator \(G_{2}\) and discriminator \(D_{2}\).  
\[L_{\text{GAN}}(G_{1},D_{1})=\mathbb{E}_{I_{nor}\sim p_{\text{data2}(I_{nor})}}[ \log D_{1}(I_{low})]+\mathbb{E}_{I_{low}\sim p_{\text{data1}(I_{low})}}[\log(1- D_{1}(I_{nor}^{fake})] \tag{7}\]  
Similarly, we can obtain  
\[L_{\text{GAN}}(G_{2},D_{2})=\mathbb{E}_{I_{low}\sim p_{\text{data1}(I_{low})}}[ \log D_{2}(I_{nor})]+\mathbb{E}_{I_{nor}\sim p_{\text{data2}(I_{nor})}}[\log(1- D_{2}(I_{low}^{fake})]. \tag{8}\]  
(2) Cycle consistency loss  
We hope that the image \(I_{nor}^{fake}\) generated by \(I_{low}\) can be consistent with the initial image \(I_{low}^{rec}\) generated by the following generator \(G_{2}\), that is, \(I_{low}\to I_{nor}^{fake}\to I_{low}^{rec}\approx I_{low}\). These things considered, using a novel approach, we combine the cycle consistency loss in the amplitude domain that can help the model learn higher-level amplitude features. Therefore, the following loss function can be obtained, which is the core of CycleGAN [19] that can remain structurally consistent with the generated normal-light images.  
\[\begin{split} L_{\text{cyc}}(G_{1},G_{2})=\mathbb{E}_{I_{nor}\sim p _{\text{data2}(I_{nor})}}[\|I_{nor}^{rec}-I_{nor}\|_{1}]+\mathbb{E}_{I_{low}\sim p _{\text{data1}(I_{low})}}[\|I_{low}^{rec}-I_{low}\|_{1}]\\ +\mathbb{E}_{A_{nor}^{real}\sim p_{\text{data3}(I_{low}^{real})}}[ \|A_{nor}^{rec}-A_{nor}^{real}\|_{1}]+\mathbb{E}_{A_{low}^{real}\sim p_{\text{ data4}(I_{low}^{real})}}[\|A_{low}^{rec}-A_{low}^{real}\|_{1}]\end{split} \tag{9}\]  
(3) Identity loss  
The meaning of this loss is that if the image of the \(I_{nor}\) domain is fed into the generator \(G_{1}\), the result should be itself as much as possible, and no other conversion should be performed. The identity loss is mainly to limit the generator \(G_{1}\) from automatically modifying the color of the input image, while ensuring the generator \(G_{1}\)'s function of generating normal-light images.  
\[L_{\text{idt}}(G_{1},G_{2})=\mathbb{E}_{I_{nor}\sim p_{\text{data1}(I_{nor})} }[\|G_{1}(I_{nor})-I_{nor}\|_{1}]+\mathbb{E}_{I_{low}\sim p_{\text{data1}(I_{ low})}}[\|G_{2}(I_{low})-I_{low}\|_{1}] \tag{10}\]  
(4) Color constant loss  
Since the CycleGAN framework is used for image style transfer and does not involve the problem of original color preservation between different styles, we add a color constant loss function to maintain the color preservation when generating normal-light images.  
\[L_{col}=mean((r_{1}-r_{2})^{2}+(g_{1}-g_{2})^{2}+(b_{1}-b_{2})^{2}), \tag{11}\]  
Figure 2: The structure of the denoiser in the phase domain.  
where \(r_{1}\), \(b_{1}\), and \(g_{1}\) are the average intensity values of the three channels of the normal-light image \(I_{nor}\); and \(r_{2}\), \(b_{2}\), and \(g_{2}\) are the average intensity values of the three channels of \(I_{nor}^{rec}\), respectively. In summary, the overall loss is as follows:  
\[L=L_{\text{GAN}}(G_{1},D_{1})+L_{\text{GAN}}(G_{2},D_{2})+L_{\text{cyc}}(G_{1},G_{2})+L_{\text{idt}}(G_{1},G_{2})+L_{col}. \tag{12}\]