## 4 Experimentation and Results
### CNN Performance
As the goal of testing different CNN configurations is to obtain an efficient method in terms of accuracy and complexity, the second image size is selected, i.e., 164 \(\times\) 122, because the difference in accuracy is not much, but the input image size is reduced by 25%. Once the size of the image has been selected, and taking into account that the final accuracy of the CNN can slightly change between different runs of training, this procedure was carried out 30 times in order to have a statistical representation of the accuracy. Figure 11 shows the boxplot for the obtained accuracy of each EMD-based method, being the CEEMD method the one that provides the best results, i.e., a mean value of 97.5% of accuracy, in a consistent way. Therefore, the CEEMD method will be the only one used from now on. The next parameters to be tested with different values are the number of filters and their size. Figure 12a shows the obtained results. For the number of filters, 3, 4, 5, 6, and 7  
Figure 11: Boxplot for the accuracy obtained by different EMD methods. Figure 10: Accuracy results for different image sizes and different EMD methods. were tested, whereas sizes of 3 \(\times\) 3, 5 \(\times\) 5, 7 \(\times\) 7, and 10 \(\times\) 10 were analyzed. As can be observed, 6 filters of size 10 \(\times\) 10 provide the highest accuracy value; yet, 5 filters of size 3 \(\times\) 3 were chosen because they represent a lower computational load. Finally, the last parameters to be modified are the number of epochs and the batch size which are related with the number of iterations in the training stage. Figure 12b shows the obtained results for 5, 10, 15,..., and 40 epochs, as well as for 32, 64, 128, and 256 as batch sizes, showing that the best relationship between the epochs and the batch number is 10 epochs with a batch of 64. After testing different values for the most common parameters of a CNN, the final proposed CNN has the following features: 5 filters of 3 \(\times\) 3 with a batch number of 64 and 10 epochs, where the input image size is 164 \(\times\) 122 and the CEEMD is the method for signal decomposition. Figure 13 shows the final proposed CNN, and Table 3 shows, in a more complete way, its characteristics. One value that can directly show the complexity reduction between the first CNN and the final CNN is the total learnable parameters of the fully connected layer. This value for the first CNN is 349,372 and 197,232 for the final CNN, representing a reduction of 43.55%. It is worth noting that this important reduction represented the main challenge of this work since many tests had to be carried out in order  
Figure 12: CNN accuracy for: (**a**) different filter configurations and (**b**) different iteration values. to determine better characteristics for the CNN structure, always taking into account the computational load and the accuracy with respect to previous publications. This was also possible due to the more reliable results provided by the CEEMD method. After obtaining the final structure of the CNN, the training and validation were completed. In this regard, Figure 14 shows the obtained confusion matrix for the validation cases: 168 images for an SCD event and 108 for a healthy patient. As can be observed, 97.5%, 97.2%, and 98.2% are obtained for accuracy, precision, and recall, respectively, indicating the reliability of the proposal. In order to assess the proposal effectiveness throughout the prediction time (i.e., 30 min), the accuracy of each minute was obtained. Figure 15 shows the accuracy obtained minute by minute, where it is observed that the values range from 100% to 97%. The dotted line indicates the average accuracy, and the black lines represent the variability obtained. Figure 14: Confusion Matrix. The correct predictions are in the green fields. The incorrect predictions are in the red fields. The numbers in green are the positive rates for each row and column. The numbers in red are the negative rates for each row and column. Figure 13: Final convolutional neural network (CNN) architecture.