## 3 Method
### Multi-Channel Multi-Scale Deep Convolutional Neural Network  
In this work, a novel MMDCNN model is proposed to detect and localize MI. The Python codes for the MMDCNN model is available at ([[https://github.com/[PERSON]/MI_VCG_DL](https://github.com/[PERSON]/MI_VCG_DL)]([https://github.com/[PERSON]/MI_VCG_DL](https://github.com/[PERSON]/MI_VCG_DL)) (accessed on 20 August 2021)). The MMDCNN architecture shown in Figure 4 comprises 12 layers. The first and last layers are interpreted as input and output layers of MMDCNN model. The input layer contains the multi-scale VCG tensor. The output layer consists of two neurons for MI detection stage, one for NSR class and the other for MI class. Similarly, for the MI localization stage, the output layer contains six neurons corresponding to six types of MI classes as AMI, IMI, ALMI, ASMI, ILMI, and IPLMI, respectively. The MMDCNN contains four convolutions, two max-pooling, and four dense layers for both MI detection and localization stages. The mathematical expression to compute the \(t\)th feature map for first convolution layer is given as follows [29; 36]:  
\[\mathbf{X}_{t}^{(l)}(\widetilde{n})=h(\sum_{n=1}^{N}\sum_{m=1}^{M}\sum_{i=1}^ {l}\mathbf{X}(n,m,i)\mathbf{K}_{t}(\widetilde{n}-n+\frac{N}{2},m,i)+b_{t}) \tag{5}\]  
where \(\mathbf{X}(n,m,i)\) is the input to the MMDCNN and \(i=1,2\ldots\ldots I\) and \(m=1,2\ldots M\), respectively. The parameters \(l\) and \(M\) are total number of modes and channels, respectively. Similarly, the mathematical expression for the evaluation of feature maps in other convolution layers are evaluated as follows [29; 36]:  
\[\mathbf{X}_{t}^{(l)}(\widetilde{n})=h(\sum_{n=1}^{N}\sum_{c=1}^{C}\mathbf{X}_ {t}^{(l-1)}(n,c)\widetilde{\mathbf{K}}_{t}(\widetilde{n}-n+\frac{N}{2},c)+ \widetilde{b}_{t}) \tag{6}\]  
\(\mathbf{X}_{t}^{(l-1)}(n,c)\) is the \(\widetilde{t}\)th feature map at \((l-1)\)th convolution layer. Similarly, the feature maps for second, third and fourth convolution layers are evaluated using Equation (6). The \(\mathbf{X}_{t}^{(l)}\) is denoted as the \(t\)th feature map for \(l\)th convolution layer. Moreover, the mathematical expression to evaluate the pooling layer feature map is given as follows [29; 36]:  
\[\mathbf{X}_{t}^{(l)}(\widetilde{n})=\text{max-pooling}(\mathbf{X}_{t}^{(l-1)} (\widetilde{n})) \tag{7}\]  
For dense layers, the feature vector is evaluated as follows [37]:  
\[\mathbf{a}^{(l)}=h(\mathbf{a}^{(l-1)}\overline{\mathbf{W}}^{(l)}+\overline{ \mathbf{I}}^{(l)}) \tag{8}\]  
where \(\mathbf{a}^{(l)}\) is the feature vector for \(l\)th dense layer. \(\overline{\mathbf{W}}^{(l)}\) is the weight matrix between \((l-1)\)th dense and \(l\)th dense layers [37]. \(\overline{\mathbf{I}}^{(l)}\) is the bias for \(l\)th dense layer. The categorical cross-entropy-based cost function is used for MMDCNN for both detection and localization stages [38]. The hyper-parameters used for MMDCNN in detection and localization stages are shown in Table 2. In this study, for both MI detection and localization stages, the hold-out validation and 10-fold cross-validation (CV) methods [37] are used to select the training and test VCG beats. For hold-out validation 78.75%, 11.25%, and 10% VCG beats are used as training, validation, and testing, respectively, for MMDCNN model during detection and localization phases. We have used the performance measures such as accuracy, sensitivity, specificity, and Kappa scores for the MI detection using MMDCNN classifier [37; 39]. Similarly, for MI localization, the overall accuracy (OA), individual accuracy (IA), and Kappa score are used to evaluate the performance in the second stage MMDCNN [6].