## 3 Material and Methods
### Proposed Method
#### 3.2.4 Myocardial Scar Quantification: Refined Segmentation  
_Working phase._ After achieving an initial segmentation of the potential damaged areas, inspired by the work of [PERSON] et al. [49] a voxel-level segmentation refinement was followed by using an ensemble of from-scratch trained CNNs. Although in the initial segmentation most lesions are detected within their core or more evident damaged areas, the method might provide misclassifications due to the overlapping healthy and infarcted intensity distributions. Thus, false positives removal (or false negatives inclusion) were tackled by a voxel reclassification approach using image patches centered at the voxels of interest. Voxels falling in a boundary region surrounding the coarse segmentation were re-classified with the aim of including in the analysis only the potentially misclassified ones. The boundary region was taken by subtracting to the morphologically dilated mask \begin{table}
\begin{tabular}{l c c c c c c c c c} \hline \hline
**Goal** & **Net** & **Patch** & **Loss** & **Optimizer** & **LR** & **M** & **MB** & **L2** & **Epochs** \\ \hline Disease Detection & VGG19 [47] & 89 \(\times\) 89 & CE & SGDM & \(1\times 10^{-4}\) & 0.9 & 16 & \(1\times 10^{-4}\) & 20 \\ Scar Segmentation & [21]* & 49 \(\times\) 49 & CE & SGDM & \(1\times 10^{-2}\) & 0.75 & 256 & \(1\times 10^{-4}\) & 50 \\ \hline \hline \end{tabular}  
* Net. Network Architecture; SGDM: Stochastic Gradient Descent with Momentum; LR: Learning Rate; M: Momentum; MB: Minibatch Size.
* L2: L2 Regularizer;
* The elemental branch of the network was used instead of the whole architecture.  
\end{table} 
Table 1: Summary of the CNN architectures used in the framework and their corresponding parameters. Figure 1: Coarse segmentation workflow. the morphologically eroded one. A disk as a structuring element with radius of 2 pixels was considered. The degree of the morphological operations was experimentally chosen by assuring a mean sensitivity of 95% over the dilated masks on the training set. Voxel label prediction was achieved afterwards by majority voting after passing each patch over a seven-component CNN ensemble. The whole refinement segmentation workflow can be appreciated in Figure 2b. _CNN architecture._ The CNN model of Figure 2a was used for the re-classification of voxels falling in the boundary of the coarse mask. The binary classification CNN (healthy vs. scar) consisted in a modified single-branch version of the architecture proposed for left ventricular myocardium segmentation in [21]. The network received input patches of size 49\(\times\)49. By using 2D convolutional blocks, max-pooling operations and FCLs, the central-patch voxel prediction was obtained through a single neuron output layer. Unlike the original implementation, rectified linear units were used as activation functions [56]. _CNN's training phase._ The network was trained from scratch by extracting boundary patches taken from the training set in a 50%-50% class balanced way. Ground-truth masks were dilated and eroded by using a disk of radius 5. Then, healthy-class patches were taken from the mask obtained after subtracting to the dilated mask the original ground-truth. Likewise, infarcted-class patches were extracted from the mask obtained after subtracting to the original infarction mask the eroded mask. In cases were the lesions were small (and hence the erosion operation degraded the whole mask) patches from the entire mask  
Figure 2: Segmentation refinement block. (**a**) CNN architecture used in the ensemble. (**b**) Refinement segmentation workflow. (**c**) Microvascular obstruction inclusion workflow. conv: Convolutional Layer; MP: Max-Pooling Layer; FC: Fully Connected Layer. \(\times\) indicates the central voxel of the patch to be reclassified. were taken. The reason for preferring boundary-close voxels instead of central ones relies on the difficulty for their detection, since partial volume effect and the so-called gray-zone areas [20] make the tissue separation difficult.