## 2 Proposed Algorithm
### Adjustment of the Discriminator Loss Function  
The loss function of CycleGAN consists of the following three main components:  
1. Generative Adversarial Network Loss is employed to train the generator to generate an image that can deceive the discriminator into believing that the generated image is authentic. This loss function is generic to the basic Generative Adversarial Network (GAN) and can be expressed for the generator \(G\) and the discriminator \(D_{Y}\) as follows:  
\[L_{GAN}(G,D_{Y},X,Y)=\mathrm{E}_{y\sim P_{data}(y)}[\log D_{Y}(y)]+\mathrm{E}_ {x\sim P_{data}(x)}[\log(1-D_{Y}(G(x))]. \tag{1}\]  
where X represents the set of original images, Y represents the set of attempted generated images, \(P_{data}(x)\) and \(P_{data}(y)\) represent the probability distributions of the original and real images, and E and log are the mathematical expectation and logarithm, respectively.  
Figure 6: Lightweight attention mechanism.  
2. Cyclic consistency loss, a loss function specific to CycleGAN, is employed to guarantee that the conversion of an image between two domains can be reversed. That is, if an image is converted from domain A to domain B and then converted from domain B back to domain A, it should be as close as possible to the original image. The cyclic consistency loss can be expressed as follows:  
\[L_{cyc}(G,F)=\mathrm{E}_{x\sim P_{data(x)}}[\parallel F(G(x))-x\parallel_{1}]+ \mathrm{E}_{y\sim P_{data(y)}}[\parallel G(F(y))-y\parallel_{1}]. \tag{2}\]  
where F stands for the generator F that is opposite to the process of generator \(D\), \(\parallel.\parallel_{1}\) is the number of paradigms, which is used to calculate the absolute value difference between the two images, and the other parameters are the same as in Equation (1).  
3. Identity Loss: This loss function is employed to encourage the generator to preserve the original identity of the image on domains that do not necessitate transformation. In other words, when the input image is already part of the target domain, the generator should endeavor to output the same image as the input. The identity loss can be expressed as follows:  
\[L_{id}(G,F)=\mathrm{E}_{y\sim P_{data(y)}}[\parallel G(y)-y\parallel_{1}]+ \mathrm{E}_{x\sim P_{data(x)}}[\parallel F(x)-x\parallel_{1}]. \tag{3}\]  
In order to target the training of the human eye on the perceptual effect of the reduced image, this article proposes the addition of the perceptual function LPIPS (Learned Perceptual Image Patch Similarity) after the traditional loss function. LPIPS [10] is a metric used to evaluate image similarity, which employs a deep learning model to assess perceptual differences. This metric is based on the assumption that even if two images are identical at the pixel level, a human observer may perceive them as different. Consequently, LPIPS employs pre-trained deep networks (e.g., VGG [11] and AlexNet [12]) to extract image features, subsequently computing the distance between these features to evaluate the perceptual similarity between images. This approach is more consistent with human perception than traditional pixel-level evaluation methods (e.g., PSNR [13], SSIM [14], and FSIM [15]), which are defined as follows:  
\[L_{LPIPS}(X,Y)=\frac{1}{N}{\sum_{i=1}^{N}}\parallel\phi_{i}(X)-\phi_{i}(Y) \parallel_{2}. \tag{4}\]  
The ultimate total network training loss function can be expressed as follows:  
\[L_{CycleGAN}=L_{GAN}+L_{\text{cyc}}+L_{\text{id}}+L_{LPIPS}. \tag{5}\]