# A Novel 1-D CCANet for ECG Classification
## 4 Experiments  
### Experimental Setup  
To assess the performance of our method, we classified 15 and 7 different types of heartbeats from the MIT-BIH and INCART databases, respectively. One major obstacle of our databases is that they are not well balanced. For instance, the normal types are over-represented while the supraventricular escape beats from INCART have few samples in comparison. To address this issue, we randomly sampled (without repetition), as in [20], 3350 heartbeats from the MIT-BIH database and 1720 heartbeats from INCART, in the proportions given by Tables 1 and 2 respectively.  
We used k-fold cross validation on the resampled heartbeats to fit the parameters of 1-D CCANet-SVD. The parameters are shown in Table 4.  
The results provided in the _Results and discussion_ subsection derive from an overall confusion matrix obtained after summing the k confusion matrices given after each fold. As in [20], we performed 10 and 5-cross validation for the data from the MIT-BIH and INCART databases, respectively.  
The code is written in Python 3.7 and we ran all the experiments on a personal computer equipped with Ubuntu 18.04. The hardware specifications of the computer are the following: 16 GB RAM, and i7-7700 CPU with a clock speed of 3.60 GHz.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Layer 1** & **Layer 2** & **Layer 3** & **Layer 4** \\ \hline \multicolumn{5}{c}{\(k=7\)} \\ \hline \(L_{1}=2\) & \(L_{2}=3\) & \(L_{3}=3\) & \(L_{4}=5\) \\ \hline \(u_{1}=35\) & \(u_{2}=35\) & \(u_{3}=35\) & \(u_{4}=50\) \\ \hline \(R_{1}=0.5\) & \(R_{2}=0.4\) & \(R_{3}=0.4\) & \(R_{4}=0.3\) \\ \hline \hline \end{tabular}
\end{table}
Table 4: Parameters for 1-D CCANet-SVD.  
To further validate our approach, we added a one-dimensional residual network (1-D ResNet) to our experiments. The input is the same as for 1-D CCANet-SVD. The 1-D ResNet has been implemented as follows:  
* _Initial layer_: the input of the network undergoes an initial convolution with 2 input channels (one for each lead) and 16 output channels. This convolution is followed by a max-pooling step. This initial layer is followed by 4 identical residual blocks.
* _Residual blocks_: each of them contains two convolutional layers and, for each block, the output of the second convolutional layer is finally added to the block's input. For each block, the first convolution doubles the number of channels, while the second convolution has the same number of input and output channels. Consequently, the last convolution has 256 output channels. The output of the last block then undergoes average-pooling to obtain the feature vector.
* _Classification layer_: the feature vector, of size 256 serves as the input of a fully connected neural network. The classification is then performed thanks to the Softmax function. The loss used is the cross-entropy.  
During the feature extraction process, Batch-Normalization is performed after each convolution and the Rectified Linear Unit (ReLU) is used as the activation function. Table 5 shows the architecture of the network and the various parameters fitted for each layer. All the parameters, including the number of layers, residual blocks and the number of channels for the convolutions were found through cross-validation.