## 2 Methodology
### Multi (12)-Lead ECG/TMT-ECG with CNN Architecture  
ECG machines in general will provide 12-lead ECG/TMT-ECG signals as output, i.e., I, II, III, aVR, aVF, aVL, V1, V2, V3, V4, V5, and V6, which correlate to the entire behavior of the heart, and each lead has different amplitude curves. The study of 12-lead ECG signals consists of all 12-lead ECG signal data, which are collected by the same procedure as with the single-lead ECG. These are in the form of a one-dimensional dataset. The resulting combined 12-lead one-dimensional dataset was used in the development of CNN architecture.  
Since CNNs perform more effectively on nonlinear datasets [43], similar architectures that are used in single-lead ECG datasets are applied to 12-lead ECGs. The defined CNN architecture worked with the input of data gathered from 552 patients. Here, each sample had 9792 parameters instead of 815 as was the case in single-lead architecture, which was recorded over time intervals. Based on a standard protocol, 80% of the data were used for training and 20% for testing conditions.  
As mentioned in Table 2, four different independent single-layer convolutional networks were developed, each using different activation functions (ReLU, leaky ReLU, SoftMax, and linear, respectively) having a kernel size of 1 and stride of 1. The output in each of the CNN models (with a shape of (9791, 64)) was flattened and flowed to the output layer through a fully-connected dense layer as illustrated in Figure 9(a). The output function defined with a dense layer consisted of the sigmoid activation function [17]. The sequential model is considered as input for all of the CNN models and the output classifications of these models were conducted through the binary classification process. Hence, all of the models were compared using the binary cross-entropy loss function [46] with the Adam optimizer [61]. This process was most suitable to classify the data for 'CAD' or 'normal data'.  
The same procedure was extended to the two-layer CNN architecture, i.e., the sequential model followed by two CNN layers. The first-layer CNN architecture output shape of (9791, 64) was the input to the second-layer CNN. This two-layer CNN architecture was developed using the best two of the effective activation function combinations (Table 2). Its output shape (9790, 32) was flattened (313280) and flowed to the final dense layer (through a fully-connected layer) with a sigmoid activation function, as illustrated in Figure 9(b).  
In the next step, the three-layer CNN architecture was designed based on the knowledge gained from the development of the two-layer CNN architecture. The three-layer CNN architecture has a sequential model of three CNN layers with output shapes of (9791,  
\begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline  & \multicolumn{4}{c}{**Single-Layer CNN**} & \multicolumn{4}{c}{**Two-Layer CNN**} & \multicolumn{4}{c}{**Three-Layer CNN**} \\ \cline{2-11}  & **N-1** & **N-2** & **N-3** & **N-4** & **N-5** & **N-6** & **N-7** & **N-8** & **N-9** & **N-10** \\ \hline Input & (9792, 1) & (964), (9790, 32), and (9789, 16), respectively, and with the best combination of two activation functions. The flattened output of the last CNN layer was fed to the fully-connected layer. The final output function consists of a dense layer with a sigmoid activation function, with an output of '0' or '1'. A value of '0' indicates 'normal health' with respect to the ECG and a value of '1' indicates the presence of 'CAD' (Figure 10b). Since it is a binary classification, the predefined binary cross-entropy loss function and Adam optimizer were used to analyze the 12-lead ECG data. To avoid the overfitting error and to obtain the best-optimized classification model, all convolutional neural network models (10 networks) were analyzed using a constant number of epoch values (25 epochs). The results of these combinational models will help to derive an effective and suitable CNN system that is valid over both types of datasets (single-lead and multi-lead datasets).