# Data Independent Acquisition Based Bi-Directional Deep Networks for Biometric ECG Authentication
## 3 Methodology
### Models Overview
#### 3.3.1 Proposed 1-D CNN Model  
Convolutional neural networks (CNNs) are neural networks built to primarily classify images, cluster images based on similarity, and perform object recognition. It was developed in the 1980s. The CNN is designed for robust training in terms of the stochastic gradient descent algorithm for each layer. Moreover, CNNs have been commonly used for feature learning and classification problems. In this report, a deep 1-D CNN is designed to perform ECG classification using a fiducial approach. The optimal parameters of the model structure are selected according to the previous works and after various lengths of trails. Moreover, all the parameters of the networks are also conducted with various settings by trial-and-error approach, and chose the optimal setting for each network which yields the most with better performance results. The weights in the models were initialized randomly at the start of the training process, and progressively updated throughout the process. The detailed network architecture of the proposed CNN model is implemented, and the respective parameters of the network used in this study are listed in Table 1.  
There are four hidden layers in the model that are used for feature learning, followed by a fully-connected layer with 40 neurons. Then, a decision-making classification layer with a sigmoid function is applied to produce the appropriate categorical distribution for each class. The intuition of the proposed CNN model is that it allows a function that differentiates the patterns and distinct characteristics of all classes based on their respective input signal. Generally, the ground truth result is indicated in a one-hot distribution vector,  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Layers** & **Kernel Size** & **Stride** & **Padding** & **Input Size** & **Output Size** \\ \hline
1 & 5 & 2 & 2 & 750 & 375 \\
2 & 2 & 2 & 0 & 375 & 187 \\
3 & 5 & 2 & 2 & 187 & 94 \\
4 & 2 & 2 & 0 & 94 & 47 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Values of parameters for proposed 1-D CNN model.  
Figure 8: Proposed bi-directional RNN network for both LSTM and GRU cell unit.  
whereas the input is a discrete sequential sample, where the data point is a vectorized representation of individual samples at time \(t\). The signals are segmented into specified windows of definite length followed by the procedure presented in the first section of this report. Each window captures at least one or more heartbeat waveforms in the original signal. The parameter values, such as filter size, stride, and padding values, are set according to Table 1 throughout the network layers from the first layer to the last layer. Convolutional operations with nonlinear activation functions are applied between each layer. In the first and second layers, 30 filters are implemented. Finally, the softmax function is used in the last layer to produce the distribution of the corresponding class for decision making in the form of a vector, in the range of 0 to 1. The cross-entropy loss function for the network's targets can be calculated as  
\[E=-\sum_{i=1}(\hat{y}_{i}log(y_{i})+(1-\hat{y}_{i})log(1-y_{i})) \tag{16}\]  
where \(\hat{y}_{i}\) is the ground truth target vector and \(y_{i}\) is the output vector of our model for class \(i\). To obtain the output in categorical distributions across all the subjects, outputs \(y_{1,...,i}\) are calculated by applying a sigmoid function to the weight sums of the activation function of the previous layer.