# An Improved Detail-Enhancement CycleGAN Using AdaLIN for Facial Style Transfer
## 3 The Proposed Method
### Stylization Module  
The structure of the facial style conversion module is shown in Figure 3, comprising a generator and a discriminator. This module deviates from the basic recurrently consistent generative adversarial network by integrating three components into its generator: a content encoder, a style encoder, and a decoder. Figure 4 provides a detailed illustration of the generator's specific structure. Figure 4: The network structure and parameters of the generator. Figure 3: Styler module structure. Figure 2: The proposed method structure. The content encoder within the generator compresses the image and incorporates feature maps using four subsampled convolutional layers, followed by two ResNet blocks for further processing to map the input content image to its content encoding. Each convolutional layer is subsequently followed by Instance Normalization (IN). The styler encoder comprises five convolutional layers and utilizes Average Pooling to vectorize the style image, resulting in the styler encoding. Subsequently, the decoder processes the content-coding through a series of AdaLIN residual blocks and ultimately reconstructs the input image using several upsampling convolutional layers. AdaLIN dynamically adjusts the weighting of Instance Normalization (IN) and Layer Normalization (LN) parameters during training, leveraging the advantages of both techniques to selectively retain or alter content information. This capability enables the model to flexibly control the degree of shape and texture changes, thereby enhancing overall robustness. Affine transformation parameters \(\gamma\) and \(\beta\) are derived from the style encoding through a Multilayer Perceptron (MLP), while the learning parameter \(\rho\) is utilized to fine-tune the Instance Normalization and Layer Normalization ratio. Specifically, affine transformation parameters \(\gamma\) and \(\beta\) are obtained via the method illustrated in Figure 5.  
As can be seen in Figure 5, the calculation of specific parameters in AdaLIN is shown in Equation (1):  
\[AdaLIN(a,\gamma,\beta)=\gamma\cdot(\rho\cdot\widehat{a_{l}}+(1-\rho)\cdot \widehat{a_{L}})+\beta \tag{1}\]  
where  
\[\widehat{a_{l}}=\frac{a-\mu_{l}}{\sqrt{\sigma_{l}^{2}+\varepsilon}} \tag{2}\]  
\[\widehat{a_{L}}=\frac{a-\mu_{L}}{\sqrt{\sigma_{L}^{2}+\varepsilon}} \tag{3}\]  
\[\rho\gets clip_{[0,\ 1]}(\rho-\tau\Delta\rho) \tag{4}\]  
With AdaLIN, the core concept is to integrate style information into the content domain, facilitating more effective style transfer and yielding superior results. Conversely, the discriminator employs PatchGAN to provide feedback to the generator. The specific parameters used are detailed in Figure 6.  
In the traditional GAN model, the output of the discriminator \(D\) network is a scalar, between 0 and 1, representing the probability of being a real image. While the PatchGAN output is no longer a scalar, but the output is an \(n\times n\) matrix \(X\). Each element \(x[i][j]\) represents a patch, corresponding to a receptive field of the image, and finally, the mean value of each patch site is taken to represent the probability that the final total picture is a real picture, and such training makes the model pay more attention to the details of the image. In this paper, we use the PatchGAN to replace the original model to discriminate  
Figure 5: The details of the improved generator. the whole image, and set the \(n\)-value to 70, to discriminate the 70 \(\times\) 70 image blocks. In this paper, except for the last convolutional layer, Instance Normalization and Leaky ReLU activation function are used after the other convolutional layers, where the value of \(\alpha\) is set to 0.2. Unlike the ReLU, Leaky ReLU has a function value of \(\alpha\times x\) when the input is negative, so that, when the input is negative, Leaky ReLU still has a weak activation effect. This mechanism integrates local image features and overall image characteristics, discerning differences through each patch to extract and characterize local image features.