# Reliable Augmentation and Precise Identification of EPG Waveforms Based on Multi-Criteria DCGAN
## 2 Materials and Methods
### Algorithmic Methods for Data Analysis  
#### 2.3.1 EPG Data Augmentation Based on DCGAN  
(1) GAN algorithmic model  
GANs are a type of unsupervised deep learning model consisting of two components, a generator and a discriminator. These two components work in an adversarial manner while simultaneously learning from each other. The generator receives random noise \(Z\) (Equation (1)) and generates data \(G(z)\) that is as realistic as possible to compete with the discriminator \(D\). The discriminator is used to distinguish whether the generated data is real, striving to accurately differentiate between the generated data \(G(z)\) and the real data \(X\). In this setup, \(G\) and \(D\) constantly compete, and their parameters are continuously optimized until an ideal result is achieved. \[MinmaxV(D,G)=E_{x\sim P_{data}(X)}[logD(x)]+Ez-p(z)[log(1-D(G(Z)))] \tag{1}\]  
In this context, \(D(x)\) represents the probability that the sample \(x\) is real data, while \(D(G(z))\) denotes the probability that the generated data \(G(z)\) is real. These probabilities range from [0, 1], where 1 indicates real data and 0 indicates non-real data. Therefore, the optimal state of this adversarial competition is achieved when \(D(G(z))=0.5\), meaning the generator can generate data that is indistinguishable from real data. According to \begin{table}
\begin{tabular}{c c c} \hline \hline
**Waveform Style** & **Number of Training Sets** & **Number of Testing Sets** \\ \hline A & 1021 & 221 \\ B & 1036 & 208 \\ C & 1087 & 218 \\ PD & 561 & 113 \\ E1 & 232 & 116 \\ E2 & 1000 & 200 \\ G & 906 & 182 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Training set and testing machine sample quantity table. Equation (1), the optimization functions for \(D\) (Equation (2)) and \(G\) (Equation (3)) can be derived as follows:  
\[MaxV(D,G)=E_{x\sim Pdata(x)}[logD(x)]+E_{z-p(z)}[log(1-D(G(Z)))] \tag{2}\]  
\[MinV(D,G)=E_{z-p(z)}[log(1-D(G(Z)))] \tag{3}\]  
(2) DCGAN algorithmic model  
The GAN has evolved into many variants, among which the architecture of DCGAN is widely used. As show in Figure 2, DCGAN replaced the fully connected layers in the generator and discriminator of the original GAN with convolutional and transposed convolutional layers. This improvement enhanced the stability of GANs and improved the quality of the generated results [21]. The data used in this study were essentially 32-bit floating-point numbers. The data were initially scaled up by \(2^{16}\) times and then converted from one-dimensional data into TIFF format images. First, the generator network was defined, which took a one-dimensional latent noise vector as input. This latent noise vector was typically randomly sampled from a Gaussian distribution. The generator network consisted of a series of transposed convolutional layers that progressively expanded the one-dimensional input data into images of appropriate size. Each transposed convolutional layer was followed by a batch normalization layer and a Leaky ReLU activation function with a slope of 0.2 to enhance training stability and introduce non-linearity (as shown in Figure 2). A fully connected layer adjusted the output to the desired image size, and a hyperbolic tangent (tanh) activation function ensured the output pixel values were within a suitable range. Figure 2: DCGAN Network Framework. Then, the discriminator network was defined, which aimed to distinguish between the real images and the fake images generated by the generator. The discriminator network consisted of a series of convolutional layers that extracted features from the input images. Each convolutional layer was followed by a Leaky ReLU activation function with a slope of 0.2. The final convolutional layer was connected to a fully connected layer with an output size of 1, which used a sigmoid activation function for classification. This setup outputted a scalar value representing the probability that the input image was real.