# Two-View Mammogram Synthesis from Single-View Data Using Generative Adversarial Networks
## 2 Materials and Methods
### Training Networks
#### 2.1.3 Feature Matching Loss  
We introduced feature matching loss as an additional loss function into CR-GAN, and examined its effects. Based on a similar idea to perceptual loss [37], feature matching loss (\(L_{FM}\)) has been proposed by [PERSON] et al. [36] for synthesizing high-resolution images with 1024 \(\times\) 1024 matrices. \(L_{FM}\) is calculated by L1 regularization from feature vectors in multiple layers of \(D\), using constraints to match intermediate representations between real and synthesized images. Introducing \(L_{FM}\) in the generator loss, \(D\) works as a multi-scale discriminator. [PERSON] et al. remarked that this loss stabilizes training and drives \(D\) to produce more natural images. In the case of forward learning, \(L_{FM}\) is calculated as follows:  
\[L_{FM}=\mathop{\mathbb{E}}_{\mathbf{x}\sim\mathbf{y}_{\mathbf{x}}}\frac{1}{N}\sum_{i=1}^{ N}[||D^{i}(G(\mathbf{v_{2}},\mathbf{\bar{z}}))-D^{i}(\mathbf{x_{2}})||_{1}], \tag{7}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Type** & **Description of Type** & **Activation** & **Input Shape** & **Output Shape** \\ \hline Layer 1 & Convolution1 & Conv2d(3,1,1) & – & 256 \(\times\) 256 \(\times\) 3 & 256 \(\times\) 256 \(\times\) 64 \\ Layer 2 & & & & 256 \(\times\) 256 \(\times\) 64 & 128 \(\times\) 128 \(\times\) 64 \\ Layer 3 & & & 128 \(\times\) 128 \(\times\) 64 & 64 \(\times\) 64 \(\times\) 64 \\ Layer 4 & & +[ReLU\(\rightarrow\)Conv2d(3,1,1)\(\rightarrow\)ReLU & ReLU & 64 \(\times\) 64 \(\times\) 64 & 32 \(\times\) 32 \(\times\) 128 \\ Layer 5 & & \(\rightarrow\)Conv2d(3,1,1)\(\rightarrow\)AvgPool2d & & 32 \(\times\) 32 \(\times\) 128 & 16 \(\times\) 16 \(\times\) 256 \\ Layer 6 & & & 16 \(\times\) 16 \(\times\) 256 & 8 \(\times\) 8 \(\times\) 512 \\ Layer 7 & & & 8 \(\times\) 8 \(\times\) 512 & 4 \(\times\) 4 \(\times\) 512 \\ Layer 8-1 & & & & 4 \(\times\) 512 & 2 \\ Layer 8-2 & & & – & 4 \(\times\) 4 \(\times\) 512 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Discriminator architecture of CR-GAN for 256 \(\times\) 256 image synthesis. where \(N\) is the total number of the layers used for the loss calculation, and \(D^{i}\) denotes the extracted feature vector in each layer of \(D\). In the case of inverse mapping,  
\[L_{FM}=\underset{\mathbf{z}\sim\mathbf{p}_{z}}{\mathbb{E}}\frac{1}{N}\sum_{i=1}^{N}[||D^{ i}(G(\mathbf{v_{1}},\mathbf{z}))-D^{i}(\mathbf{\bar{x}})||_{1}]. \tag{8}\]  
Figure 3: Resolution transition in the progressive growing technique. This is an example of the transition from 64 \(\times\) 64 to 128 \(\times\) 128 resolution. When a new layer generating a 128 \(\times\) 128 feature vector is inserted into the generator, a 64 \(\times\) 64 feature vector from the last layer is 2\(\times\) up-sampled using the bilinear method. The up-sampled vector weighted by (1-\(\alpha\)) and the newly inserted vector weighted by \(\alpha\) are summed. In the discriminator and encoder, the newly inserted 128 \(\times\) 128 image is translated to a feature vector with 64 channels and then down-scaled, using the nearest neighbor method, to 64 \(\times\) 64 resolution. The weighted downscaled vector and vector from the next layer are also summed. Figure 2: Gradually increasing image resolution in the generator, discriminator, and encoder as training advances through the progressive growing technique. When the image input into the discriminator has a resolution ranging from 32 \(\times\) 32 to 128 \(\times\) 128, we set \(N\) to 3, and \(D^{i}\) was extracted from the three middle layers. The shape of \(D^{1}\) depends on the input image size to \(D\), as illustrated in Figure 4. \(D^{2}\) and \(D^{3}\) are the feature vectors with 32 \(\times\) 32 \(\times\) 128 and 8 \(\times\) 8 \(\times\) 512 shapes, respectively. When a 256 \(\times\) 256 or 512 \(\times\) 512 image is fed into \(D\), we change \(N\) to 2 to reduce the training time and GPU load. Accordingly, \(L_{FM}\) is calculated using two vectors with shape 128 \(\times\) 128 \(\times\) 64 and 8 \(\times\) 8 \(\times\) 512, respectively.