# WGAN-Based Realization Process of Gravel Soil for Hydraulic Property Simulation
## 3 Model Training
### 3D Deep Convolutional Neural Network for GANs  
The integration of Convolutional Neural Network (CNN) layers into Generative Adversarial Networks (GANs), which produces Deep Convolutional GANs (DCGANs), has significantly enhanced the efficiency of network architectures [11]. Unlike traditional GANs, DCGANs specify a structured architecture:  
The discriminator replaces pooling layers with convolutional layers, while the generator replaces them with deconvolution layers (transposed convolution layers).  
Both the generator and discriminator employ batch normalization, enhancing training stability and convergence.  
In deeper architectures, fully connected hidden layers are eliminated.  
The generator uses ReLU activation in all layers except the output layer, which employs Tanh to constrain outputs between \(-1\) and \(1\).  
The discriminator uses LeakyReLU activation across all layers to improve non-linearity and address issues like neuron death.  
Figure 2: Overview of the GAN training process. In GAN training, segmented volumetric images are divided into smaller voxel training images. The generator (G) creates synthetic images from random latent space (\(\mathbf{Z}\)) samples, which are assumed to follow a uniform distribution \(-U\) (\(-1\),\(1\)). The discriminator (D) distinguishes between real training images (scored as \(s_{\mathrm{r}}\)) and generated images (scored as \(s_{\mathrm{G}}\)) using binary cross-entropy. Through iterative training, the generator improves to produce high-quality images that deceive the discriminator. Training stops when desired image quality is achieved, and the generator can then generate new realizations by inputting larger latent vectors for larger output images.  
DCGANs have extended into three-dimensional models for tasks such as X-ray CT imaging, MRI scanning, and imaging of optically transparent media. These 3D-DCGANs utilize volumetric convolutional networks to generate \(64\times 64\times 64\) voxel-sized images from latent vectors sampled from a probabilistic latent space \(\mathbf{Z}\). Unlike CNNs that extract features from images, 3D-DCGANs amplify features from random signals using deconvolution, reconstructing them into new images. The architectures of the generator and discriminator of the 3D Deep Convolutional GAN in this work is shown as Table 1.  
In this context, the architecture of the 3D Deep Convolutional GAN includes a generator with five blocks, each comprising a transposed deconvolutional layer, batch normalization, and ReLU activation. The final block uses Tanh to output images constrained within \(-1\) to \(1\). This process involves mapping a random noise vector \(z\sim p_{z}\) to generate an image \(x_{G}\sim p_{G}\). The discriminator is structured with four convolutional layers and one fully connected layer using LeakyReLU activation for processing binary images.  
Training the 3D-DCGAN involves using the RMSprop optimizer across 500 epochs, with a batch size of 64 and a learning rate of 0.0002. The loss function incorporates a gradient penalty term to prevent issues like mode collapse and gradient explosion, ensuring stable and effective training of the network.