# Reliable Augmentation and Precise Identification of EPG Waveforms Based on Multi-Criteria DCGAN
## 2 Materials and Methods
### Algorithmic Methods for Data Analysis
#### 2.3.2 CNNs Classification Model  
CNNs are one of the most widely used feedforward neural network structures in the field of deep learning. They include convolution operations and have a deep structure. CNNs can effectively handle one-dimensional or multi-dimensional data, such as image data, time series data, video data, etc. The main components of CNNs include the input layer, convolutional layer, pooling layer, fully connected layer, and output layer [22; 23].  
Convolutional Layer: The main function of the convolutional layer is to extract features from the input data through local operation. The convolutional layer contains multiple convolutional kernels, each consisting of a set of weight coefficients and a bias vector. Each element of the convolutional kernel performs a convolution operation with the corresponding region of the input feature, known as the receptive field. Typically, the convolutional kernel is square-shaped. During the operation, the convolutional kernel slides systematically over the input features, performing matrix element multiplication and summation within the receptive field, followed by adding the bias term to generate a single pixel value in the output feature map [24].  
\[\begin{split} Z^{L+1}(i+j)=[Z^{L}\otimes w^{l+1}](i,j)& +b=\sum\limits_{k=1}^{k}\sum\limits_{x=1}^{f}\sum\limits_{x=1}^{f}\left[Z_{k} ^{l}(s_{0}i+x,s_{0}j+y)w_{k}^{j+1}(x,y)\right]+b\\ (i,j)&\in\{0,1,\ldots.L_{l+1}\}\\ L_{l+1}&\frac{L_{l+2p-f}}{s_{0}}+1\end{split} \tag{4}\]  
where \(b\) represents the bias term, and \(l\) and \(O\) represent the input and output of the \(l+1\) convolutional layer, respectively, which are also referred to as feature maps. \(L[l+1]\) is the size of \(O\). \(Z(i,j)\) corresponds to the pixel of the feature map. \(K\) is the number of channels in the feature map, and \(f\), \(S_{0}\), and \(p\) correspond to the size of the convolutional kernel, the stride, and the padding number, respectively.  
Pooling Layer: The primary purpose of the pooling operation is to perform down-sampling. The principle of the non-linear pooling function is to replace individual pixel values in the feature map with statistical values from their neighboring regions. During the pooling operation, the spatial dimensions of the data are reduced while preserving the key features, gradually decreasing the size of the feature map. In this process, the number of parameters and the computational load are also reduced accordingly, which helps to control overfitting to a certain extent [25].  
Fully Connected Layer: The fully connected layer is analogous to the hidden layers in a traditional feedforward neural network. It is typically located at the final part of the network and serves to transmit signals to other fully connected layers.  
In CNN, multiple convolutional and pooling layers are usually set up in an alternating manner. Each neuron in the convolutional layer connects to a local region of the previous layer and extracts features from that region. The pooling layer is responsible for local sensitivity and secondary feature extraction. This alternating structure of convolutional and pooling layers helps to reduce feature resolution and the number of parameters that need optimization.  
In this study, the CNN network employed a structure where convolutional and pooling layers were alternately stacked. Initially, the input layer received the preprocessed data and performed 16 convolution operations, followed by batch normalization and a ReLU activation function to accelerate training and introduce non-linearity. A max-pooling layer was then applied to reduce the feature map size and extract the most important features. This was followed by 32 convolution operations, batch normalization, ReLU activation, and another max-pooling layer. Finally, the fully connected layer integrated these features and used a Softmax layer for multi-class classification.