# Adversarial Data Augmentation on Breast MRI Segmentation
## 2 Methods
### Adversarial Generator
#### 2.2.3 Pix2 PixHD  
Another approach towards better resolution generative setups came in the form of Pix2 PixHD [17]. This architecture with no _cycle-consistency_ employed a more complex generator of residual blocks and a multi-scale discriminator.  
Figure 3 shows the generator architecture of Pix2 PixHD. The generator network can be divided into the global generator (\(G_{1}\)) and the local enhancer (\(G_{2}\)). The \(G_{1}\) follows the pipeline of ResGAN (Figure 1), only differing by receiving a 2 times downsampled version of the input and returning an image at that same decimated resolution.  
The local enhancer, however receives the original input and reduces the resolution to the same size of the decimated image using a \(C_{32}\)-\(C_{64}\) front-end network. This other partial output is summed element-wise with the last feature map from \(G_{1}\) (before the image output), and fed to the \(G_{2}\) back-end network. This back-end processes the input with  
Figure 2: CycleGAN architecture diagram.  
another series of residual blocks (3\(\times\)\(R_{64}\) in our case) and finally outputs a generated image after the transposed convolution, complementary to those of the \(G_{2}\) front-end (\(C_{32}\)-\(C_{1}\)).  
The discrimination component of the network is composed of 3 PatchGAN models, in a pyramidal scheme (\(D_{1}\), \(D_{2}\) and \(D_{3}\)). Each operates at a different resolution level, dealing with data at the input scale (\(D_{1}\)) and with downsampled versions of factors 2 (\(D_{2}\)) and 4 (\(D_{3}\)). Both real and synthetic images suffer this discrimination and the results are combined to get a single adversarial loss.  
This strategy was devised to avoid using a unique discriminator with a large receptive field, which would be necessary for the intended image resolution. The usage of a deeper architecture or larger convolutional kernels would translate to a larger model and induce overfitting. It was also shown that the multi-scale discriminators avoid pattern repetition over the images [17].  
The reported Pix2 PixHD loss function includes two additional terms, focusing on feature matching and perceptual loss.  
For the feature matching component, each intermediate feature map (\(D^{(i)}\)) along each discriminator scale (\(D_{k}\)) is obtained for an image. The loss consists of computing the \(L_{1}\) distance between the feature maps for a real image and a synthetic one. This loss is shown in Equation (3).  
\[\mathcal{L}_{FM}(G,D_{k})=\mathbb{E}_{x,y}\sum_{i=1}^{T}\frac{1}{N_{i}}\Big{[} \Big{\|}D_{k}^{(i)}(x,y)-D_{k}^{(i)}(x,G(x))\Big{\|}_{1}\Big{]} \tag{3}\]  
Here, \(T\) is the total number of layers, and \(N_{i}\) is the number of elements of the \(i\)th layer.  
The perceptual loss enforces a similar logic to that of the feature matching, however, it makes use of the layer responses of the pre-trained VGG network [23]. The calculation is done through Equation (4), where \(F^{(i)}\) represents the \(i\)th layer with \(M_{i}\) elements on the VGG network.  
\[\mathcal{L}_{percep}(y,G)=\sum_{i=1}^{N}\frac{1}{M_{i}}\Big{[}\Big{\|}F^{(i)}(y )-F^{(i)}(G(x))\Big{\|}_{1}\Big{]} \tag{4}\]  
The complete loss function is present in Equation (5).  
\[\mathcal{L}(G,D_{k})=\sum_{k=1,2,3}\mathcal{L}_{GAN}(G,D_{k})+\lambda\sum_{k= 1,2,3}\mathcal{L}_{FM}(G,D_{k})+\lambda\mathcal{L}_{percep}(y,G) \tag{5}\]