## 3 Materials and Methods
### GAN for Augmentation  
Our GAN design is a DC-GAN, originally introduced by [PERSON] et al. [19] in 2015 and built by using the code in [18]. Like all GANs, our design has a generator and a discriminator. Our model requires the machine learning libraries: TensorFlow and Keras. The dataset is first resized to 64\(\times\)64 and then loaded in the model for processing. The generator model architecture is made in a way that creates images, while the discriminator architecture functions to differentiate between generated and real images.  
The main layers used to create a generator are dense, LeakyReLU activation, Reshape, and transposed convolutional layers. The generator starts with the dense layer with \(8\times 8\times 512\) neurons, followed by LeakyReLU activation. These neurons are upsampled through 4 transposed convolutional layers with filters added. Filters are progressively decreasing as 256, 128, and 64, each filter followed by LeakyReLU except for the last layer, which uses the hyperbolic tangent function tanh. Here, the number of color channels was set to 1 as we generated greyscale images. The model is compiled by binary cross entropy and optimized by Adam optimizer.  
The discriminator takes an input image size of \(64\times 64\times 1\), which is either a real image from the original dataset or generated images from the generator model. The discriminator model consists of 4 convolutional layers with increasing filters, 64, 128, 128, and 256, and the kernel used in convolutional layers is \(3\times 3\). The convolutional layers progressively downsamples the image while increasing the depth of feature maps. All layers are followed by the LeakyReLU activation function, which adds non-linearity to the code and helps understand complex data. After these convolutional layers, the image is flattened into a 1D vector, and a dropout and dense layer is applied. The dropout layer prevents overfitting by deactivating a fraction of neurons with a dropout rate of 0.4. The dense layer with a single neuron and sigmoid activation is added to the discriminator to indicate whether an image is real or fake. The main idea was to use transposed convolutional layers in the generator and the convolutional layers in the discriminator. The model is compiled by binary cross entropy and optimized by Adam optimizer. A function called'sample_images' is called to generate images from the noise input using GAN generator architecture. Table 1 refers to the hyperparameters used in the code with actual numbers representing how the network is trained.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Hyperparameters** & **GAN Model** \\ \hline Noise Dimension & 100 \\ \hline Batch size & 4 \\ \hline Epochs & 100 \\ \hline Steps per epoch & 3750 \\ \hline Learning Rate & 0.0002 \\ \hline Decay Factor & 0.5 \\ \hline Image Dimension of training data & 64 \(\times\) 64 \\ \hline Channels & 1 \\ \hline Dropout rate for discriminator & 0.4 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Hyperparameters used in the Generative Adversarial Network code for generating augmented data.  
The original code is available at [[https://github.com/rklen/GAN_for_brain_tumor_MRIs/tree/main](https://github.com/rklen/GAN_for_brain_tumor_MRIs/tree/main)]([https://github.com/rklen/GAN_for_brain_tumor_MRIs/tree/main](https://github.com/rklen/GAN_for_brain_tumor_MRIs/tree/main)) (accessed on 23 August 2024).