# Advanced Elastic and Reservoir Properties Prediction through Generative Adversarial Network
## 3 Pix2 pix and Multiscale PatchGAN of Pix2 Pix  
Pix2 pix is a generalized image-to-image translation network that is based on a conditional GAN [22]. It comprises a generator, \(G\), and a discriminator, \(D\). In the original pix2 pix network, \(G\) is U-NET while \(D\) is PatchGAN. \(G\) takes the observed data \(x\) and the random noise vector \(z\) as its input and generates an output, \(y^{\prime}\).  
\[G:\{x,z\}\to y^{\prime} \tag{1}\]  
\(G\) is trained to produce plausible outputs that are indistinguishable from the label data (real) while \(D\) is trained to detect whether its incoming input is real (from the label data) or fake (generated by \(G\)). Both \(G\) and \(D\) are competing with each other in a min-max game in which \(G\) is trying to minimize its loss by producing output as similar as possible to the true label (Figure 1) while \(D\) is trying to maximize its \"correctness\" at detecting whether its incoming input is real, \(y\), or fake, \(y^{\prime}\) (Figure 2). The ability of pix2 pix to transform different images is helped by its two objective functions: reconstruction loss, \(l_{L1}(G)\) (Equation (2), and conditional GAN adversarial loss, \(l_{cGAN}(G,D)\) (Equation (3). In the reconstruction loss, the difference between the label \(y\) and the generated output \(y^{\prime}\) is calculated in L1 distance as L1 encourages less blurriness [22]. The adversarial loss, on the other hand, is given by the sum of the likelihood of \(D\) correctly classifying the real data as real and the generated data as fake.  
\[l_{L1}(G)=E_{x,y,z} \tag{2}\]  
\[l_{cGAN}(G,D)=E_{x,y}[logD(x,y)]+E_{x,z}[log(1-D(x,G(x,z)))] \tag{3}\]  
The final objective function is  
\[G=argminGmaxDl_{cGAN}(G,D)+\lambda l_{L1}(G) \tag{4}\]  
with \(\lambda\) being the regularization coefficient.  
**Proposed Network**  
The proposed network is an enhanced version of the original pix2 pix. The general idea is to use the original pix2 pix in two (2) runs. The first run (Figure 3), together with all the default hyperparameters, is used to obtain the base model. This base model is re-trained in the second run, but this time, the kernel size of the discriminator is changed from 4 \(\times\) 4 to 3 \(\times\) 3 (Figure 4). In theory, a smaller kernel size would mean high-resolution feature extraction, but it cannot be too small or there will not be enough information for the kernel can extract. In addition, the proposed solution is also based on StarGAN [23], an approach in which only a single network is trained for performing image-to-image translation of multiple domains. Such a unified model architecture allows for the simultaneous training of multiple datasets with different domains within a single network. We have adapted this idea of transforming the seismic data into four different reservoir and elastic properties by using only one model. The summary of our proposed network can be seen in Table 1.  
Figure 1: A diagram for generator training. The generator takes the input and is trained to produce output that is similar and indistinguishable from the label data. The prediction is generated by the generator and the target is the label. The reconstruction loss is calculated based on the difference between the generated output and the label. The generated output is also sent to the discriminator to “fool” it. The adversarial loss is given by the ability of the discriminator to correctly classify the generated output as fake and the label as real. The total loss for the generator training is the sum of the reconstruction loss and the adversarial loss.  
Figure 2: A diagram for the discriminator training. The discriminator loss is the adversarial loss, which is the ability of the discriminator to correctly classify the generated output as fake and the label as real. It is worth noting that in conditional GAN, the discriminator sees the input too.