# Image-to-Image Translation Using Identical-Pair Adversarial Networks
## 3 Methods
### Proposed Loss Functions  
\[\underset{\text{G}}{\text{minmax}}\text{V}(\text{G},\text{ D})=\text{ E}_{\text{y-P}_{\text{data}}}[\log(\text{D}(\text{y}))]+\text{E}_{\text{z-P}_{\text{z}}}[\log(1- \text{D}(\text{G}(\text{z})))], \tag{1}\]  
We will start with GANs here. A generative network G maps samples from input noise \(p_{z}\) to real data \(p_{data}\) through a training procedure of playing a minimax game with a discriminative network D. During training, the discriminator network D attempts to distinguish the real sample y-pdata from the generated image G(z). The generative network G aims to confuse network D by generating realistic images iteratively. Equation (1) is the formula of minimax game mentioned above, where then became generative adversarial loss:  
In our methods, we adopt the GANs learning strategy to solve our tasks, because GANs-based methods recently have revealed their strong ability to learn generative models such as image generation [27; 29; 36]. As shown in Figure 1, we generated transformed image T(x) through network T given x \(\in\) X. Every input image x has a corresponding ground-truth image y, where y \(\in\) Y obeys the distribution \(p_{data}\) real-world images. However, in our approach, network D considers two inputs as a real pair or fake pair. A real pair means a pair of identical images, e.g. y and y. In this logic, the discriminative network D considers the input images as a real identical-pair when both inputs are y and as a fake identical-pair when one is a generated image T(x) and the other is a real sample y. Therefore, based on GANs, we obtain our generative adversarial loss equation as below:  
\[\underset{\text{T}}{\text{minmax}}\text{V}(\text{T},\text{ D})=\text{ E}_{\text{y-Y}}[\log(\text{D}(\text{y},\text{ y}))]+\text{E}_{\text{x-X},\text{y-Y}}[\log(1-\text{D}(\text{T}(\text{x}), \text{y}))], \tag{2}\]  
The transformation network T aims to fool the discriminator network D. Therefore, in practice, the transformation network needs to update itself by minimizing its loss function:  
\[\text{T}^{*}=\text{argmin}\Big{(}\text{E}_{\text{x-X},\text{y-Y}}[\log(1-\text {D}(\text{T}(\text{x}),\text{y}))]\Big{)}, \tag{3}\]  
\[\text{T}^{*}=\text{argmax}\Big{(}\text{E}_{\text{x-X},\text{y-Y}}[\log(\text{ D}(\text{T}(\text{x}),\text{y}))]\Big{)}, \tag{4}\]  
where, T* is our objective function for transformation network T. We train T using Equation (4) rather than Equation (3), which always saturates too early [26]. Now our last loss function is a perceptual loss. Figure 1 of our proposed approach also shows how to obtain the distance between generated image \(T(x)\) and the ground truth \(y\) with discriminator network D which actually has two streams of VGG network. We extract feature stack from j layers and \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{4}{c}{**Discriminative Network D**} \\ \hline
**Layers** & **Kernel** & **Stride** & **Channels** & \(\mathbf{W\times H}\) & **Activation** & **BN** \\ \hline Input: image1, 2 to network streams & 3 & \(256\times 256\) & LeakyReLU & True \\ \hline Conv. Layer 1 & 4 & 2 & 64 & \(128,128\) & LeakyReLU & True \\ \hline Conv. Layer 2 & 4 & 2 & 128 & 64,64 & LeakyReLU & True \\ \hline Conv. Layer 3 & 4 & 2 & 256 & 32,32 & LeakyReLU & True \\ \hline Conv. Layer 4 & 4 & 2 & 512 & 16,16 & LeakyReLU & True \\ \hline Conv. Layer 5 & 4 & 2 & 1024 & 8,8 & LeakyReLU & True \\ \hline Conv. Layer 6 & & 1 & 8,8 & & & \\ \hline \multicolumn{4}{c}{Concatenate (stream1, stream2)} \\ \hline \multicolumn{4}{c}{Output: real or fake pair} \\ \hline \hline \end{tabular} Note: This network has two CNN streams, and they share the same parameters. Therefore, we show only one stream of information.  
\end{table} 
Table 2: The architecture of the Discriminative Network D.  
unit-normalize in the channel dimension, which we designate as \(y^{\prime}_{jhw^{\prime}}\), \(T^{\prime}_{jhw}(x)\in\mathbb{R}^{H_{j}\times W_{j}\times C_{j}}\) for layer j.