# Conditional Generative Adversarial Networks for Domain Transfer: A Survey
## 2 The Development Methods of CGAN
### XGAN  
Generally speaking, in order to simplify the calculation of the consistent cyclic loss, most researchers usually encode the related variables to a fixed length, while this method does not accommodate the generality when there is a large domain displacement between two domains. Therefore, XGAN [47] establishes two auto-encoders in two domains, and both domains have an encoder and an decoder, respectively, as shown in Figure 5a, to solve this problem. Specifically, Encoder 1 and Decoder 1 were combined as an auto-encoder in domain \(x\) to obtain the semantic characteristics of the images here. Domain \(y\) has the same constitution (Encoder 2 and Decoder 2). It should be noted that the last several layers of Encoder 1 and Encoder 2 are associated with each other so that the associate semantic features can be produced when encoders encode the images in their own domain. The same occurs to Decoder 1 and Decoder 2 to allow the two domains to generate relevant semantic features. In order to strengthen the semantic relationship in two domains, XGAN defines the domain adversarial loss, \(L_{\text{dann}}\), to embed the image features of two domains into the same subspace and moderate the differences in semantic features between two domains, as shown in Figure 5b. From this, we could also see that the images in different domains are still encoded by their own encoders to obtain the semantic features, which would be then decoded by their decoders to restore the image. The binary classification model \(C_{\text{dann}}\) is trained to classify the resource of the semantic features in the current semantic space, namely from Encoder 1 or Encoder 2. Simultaneously, Encoder 1 and Encoder 2 are aimed to prevent \(C_{\text{dann}}\) from being identified by decreasing the accuracy of the classification,  
Figure 5: The framework of XGAN. Generally speaking, it is composed of two encoders and two decoders. As for the loss function, \(L_{\text{dann}}\) assures the quality of the encoding, and \(L_{\text{sem}}\) preserves the semantics after domain transfer. Specifically, in (**a**), each domain in XGAN has their own encoder-and-decoder. In (**b**), the domain adversarial loss is used to moderate the differences in semantic features between two domains. In (**c**), the semantic consistency loss is used to ensure that the semantic features generated have the same meanings in different domains. (**d**) Is the whole architecture of XGAN. which could, in turn, enable them to represent images with similar semantic features in their own domains. However, the above mechanism could only ensure that the semantic features generated between the images of the two domains are similar in phenotype but cannot indicate that they have the same meanings in different domains. For example, suppose that the semantic vectors generated by the encoders in the two domains are similar, where domain \(X\) means people with black hair and big eyes are a little angrry and domain \(Y\) means people with golden hair and small eyes are laughing happily--they represent two totally different internal meanings. Therefore, XGAN defines semantic consistency loss, i.e., \(L_{\text{sim}}\), to solve this problem, and its intuitive form is shown in Figure 5c. It can be seen that the images in domain \(X\) will be obtained with semantic features by encoder 1 first, and then be decoded by decoder 2 in the domain \(Y\). Now the restored image will be sent to encoder 2 to obtain semantic features by encoder 2. Minimizing the difference between the restored image and the original input image will make the semantic features in the two domains require relevance in meaning. In a word, the architecture of XGAN is shown in Figure 5d. Furthermore, the main purpose of this subsection is to allow readers to gain a generic understanding of CGAN and some typical variants of CGAN as much as possible. While most typical related works are discussed in this paper, we can not list many other variants of CGAN to uphold the focus of our contribution in this paper.