# Conditional Generative Adversarial Networks for Domain Transfer: A Survey
## 2 The Development Methods of CGAN
### The Improvement of CGAN
#### 2.2.2 Cycle Consistency  
CycleGAN  
The framework of CycleGAN is shown in Figure 2. It consists of two generative networks and two discriminative networks. Let \(G\) become a generative network converting an image from domain \(X\) to domain \(Y\). After the original input \(x\) obtains the output \(\hat{\mathbf{Y}}\) through \(G\), if \(\hat{\mathbf{Y}}\) is fed back into \(F\), the original input \(x\) should be retrieved. This is equivalent to having the image loop back to the starting point and keeping it consistent. Its total loss consists of four parts: firstly, two losses formed by two discriminative networks will guide the generative networks to generate more realistic images for the target domain, which is consistent with the loss function corresponding to raw GAN; secondly, two loop losses will guide the generative networks to generate images that are as close as possible to the input image. Its loss function is \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Methods**} & **Adversarial** & **Content** & **Perception** & **Hidden Variable** & **Category** \\  & **Loss** & **Loss** & **Loss** & **Loss** & **Loss** \\ \hline Laplacian Pyramid [28] & ✓ & ✓ & & & \\ SRGAN [29] & ✓ & ✓ & & & \\ Amortised MAP Inference [30] & ✓ & & & & \\ ESRGAN [14] & ✓ & ✓ & ✓ & & \\ Pixel-Level Domain Transfer [31] & ✓ & & ✓ & & ✓ \\ Markovian GAN [32] & ✓ & & ✓ & & \\ Generative Visual Manipulation [33] & ✓ & ✓ & ✓ & & \\ ICGAN [34] & ✓ & ✓ & & & \\ pix2 pix [35] & ✓ & ✓ & & & \\ Scribbler [36] & ✓ & ✓ & & ✓ & \\ CycleGAN [15] & ✓ & ✓ & & & \\ DiscoGAN [26] & ✓ & ✓ & & & \\ DualGAN [37] & ✓ & ✓ & & & \\ pix2 pixHD [25] & ✓ & & & ✓ & \\ MUNIT [38] & ✓ & ✓ & & & \\ StarGAN V2 [39] & ✓ & ✓ & & & ✓ \\ ExprGAN [40] & ✓ & ✓ & ✓ & & ✓ \\ AttGAN [19] & ✓ & ✓ & & & ✓ \\ STGAN [41] & ✓ & ✓ & ✓ & & \\ SynCGAN [42] & ✓ & ✓ & & & ✓ \\ StackGAN [16] & ✓ & & & & ✓ \\ StackGAN++ [43] & ✓ & & & ✓ & \\ MirrorGAN [44] & ✓ & & ✓ & ✓ & \\ DM-GAN [45] & ✓ & & ✓ & & ✓ \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The usage of loss functions in various methods. \[ \begin{split} L_{\text{cyc}}(G,F)=&\mathbb{E}_{\mathbf{x} \sim P_{\text{data}}(\mathbf{x})}[\|F(G(\mathbf{x}))-\mathbf{x}\|_{1}]\\ &+\mathbb{E}_{y\sim P_{\text{data}}(\mathbf{y})}[\|G(F(\mathbf{y}))-\mathbf{y} \|_{1}],\end{split}  \tag{8}\]  
where \(\|\cdot\|_{1}\) is \(l_{1}\) norm. StarGAN  
CycleGAN uses the idea of cycle consistency to realize the conversion of images on two domains. However, in this method, a target domain requires a large number of generative networks, namely, \(n\) domains require \(\dfrac{1}{2}n(n-1)\) generative networks. In addition to high complexity, inadequate utilization of data may lead to the unsatisfactory quality of generated images, and it is impossible to train domains together from different data sets. Therefore, reference [27] proposes StarGAN to solve the problem of multi-domain transformation, which only trains a single generator with data from multiple domains to ensure the generated images contain different domain styles. The training process of StarGAN is shown in Figure 3. It also uses two constraints, conditional generative adversary and cyclic consistency. Figure 3a represents the training of the discriminative network. The real images and the generated images are transferred to the discriminative network, which needs to determine the authenticity of all images and their corresponding domains. Figure 3b represents the training of the generative network, where the generator receives both the input images and the target domain label. Figure 3c represents the process of cycle consistency. It will take the image generated by the previously generated network with the original domain label as the input of the generated network. Figure 3d represents the training of the discriminator, which aims to distinguish whether the image is real or not and whether in the correct domain.