## 3 Material and Methods
### Proposed Method
#### 3.2.2 Myocardial Abnormality Detection  
In this step, a binary classifier is built for discriminating healthy and pathological images. Considering that in most slices the area defined by the epicardium resembles a disk, its centroid is estimated. Afterwards, cropped images (size 89 \(\times\) 89, 3-channel replicated) masked within the myocardium and centroid-centered are used as inputs of the classifier. Note that a rough estimation of the centroid is only needed, since the aim of this step is just image cropping. The motivation for cropping the images is for helping the CNN training by reducing the processing area [36] and for allowing the algorithm to run in portable laptops with a small GPU. _Working phase_. For achieving the classification task, a three-step approach is conducted: \((i)\) Fine-tuned VGG19 [34] models are used for extracting informative features characterizing the myocardial images. \((ii)\) Extracted features followed a principal component analysis dimensionality reduction by their projection into the learned principal-components space. \((iii)\) Images are finally classified as healthy or infarcted by using SVM. _Training phase I: Feature extraction_. The ImageNet pretrained VGG19 [47] model was chosen over other network architectures (such as VGG16, Resnet50, Resnet101, and GoogleNet) based on an exploratory performance analysis. In previous works, the model shows suitability and good adaptability for working in the medical domain [48; 49]. Since the main aim of this block is to devise a robust image classifier, only experiments with the achieved outperforming network are shown. The model was fine-tuned using MR images by preserving all layers and their corresponding weights with exception of the three ending fully-connected layers (FCL), whose neuron weights were re-learned. Besides, after the last 1000-neuron FCL, an extra 2-neuron FCL with a softmax layer were added for conducting the required binary classification (_Healthy_ vs. _Diseased_). The network training parameters are summarized on Table 1. For the replaced FCL, the learning rate was 30 times higher than the value shown on the table. Data imbalance was addressed by randomly under-sampling in each training epoch the majority class until reaching the minority class size [50; 51]. Considering the dataset size limitations and with the aim of overfitting avoidance we \((i)\) performed data augmentation for increasing the training set by considering random geometric image transformations (rotation, shearing, flipping and scaling) \((ii)\) shuffled the training set in every epoch, \((iii)\) applied a random dropout [52] of 50% after each fully connected layer and \((iv)\) applied an early-stopping criterion by monitoring the validation set loss. Once the network was fine-tuned, the whole training set was re-fed to the fitted network and image features were extracted from the 1000-FCL. Afterwards, the matrix of observations \(X_{Nx1000}\) (where \(N\) is the number of training samples) was built. _Training phase II: Classifier fitting_. For conducting dimensionality reduction, a principal component analysis was performed. The K principal components (K \(<<\) 1000) that preserve 95% of the data variance were retained. Afterwards, with the reduced observation matrix \(X_{NxK}\) a SVM with linear kernel was fitted for classifying normal and infarcted myocardium images. The SVM cost parameter was empirically chosen in a cross-validation scheme. _Model validation_. One-hundred random dataset splits were conducted in a class balanced 80-10-10% (training-validation-test) approach by including all subject slices in the same subset. For each training/validation set, fine tuning of VGG19, dimensionality reduction and SVM fitting were performed. Afterwards, over the test-set, the label prediction was performed. Obtained classifiers were characterized and evaluated by means of a receiver-operating characteristic (ROC) curve analysis.