# Heart Attack Detection in Colour Images Using Convolutional Neural Networks
## 4 Results  
For the assessment of the developed system, 2394 images of the \"Infract\" class and 2394 of the \"No Infract\" class were taken. The sensitivity, specificity, and accuracy (in percentages) of the proposed CNN-based method for heart attack detection were calculated as:  
\[sensitivity=\frac{TP}{TP+FN}\times 100, \tag{1}\]  
\[specificity=\frac{TN}{TN+FP}\times 100, \tag{2}\]  
Figure 5: Comparison of training accuracy (**left**) and loss (**right**) for the four distributions. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Distribution** & **Training** & **Validation** & **Test** \\ \hline A & 80\% & 15\% & 5\% \\ B & 70\% & 15\% & 15\% \\ C & 70\% & 0\% & 30\% \\ D & 80\% & 0\% & 20\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Percentage of data set images used in each distribution for training, validation, and testing. \[accuracy=\frac{TP+TN}{TP+TN+FP+FN}\times 100, \tag{3}\]  
where \(TP\) (true positives) is the number of images correctly identified as an infarct, \(FN\) (false negatives) is the number of images incorrectly identified as no infarct, \(FP\) (false positives) is the number of images incorrectly identified as an infarct, and \(TN\) (true negatives) is the number of images correctly identified as no infarct. In this case, \(FP=224\), \(FN=171\), \(TP=2223\), and \(TN=2170\). These numbers obtained a sensitivity of 92.85%, a specificity of 90.64%, and an accuracy of 91.75%. Although the detection of heart attacks using the strategy proposed here is unprecedented, there are multiple works focused on identifying specific human activities and abnormal behaviours. This is the reason why the present work compares the obtained accuracy with reference works that identify other types of events (see Table 4). As shown, our method overtakes previous works with similar approaches in terms of accuracy. This demonstrates that our proposal can be used as an effective way to classify events in human activities, even when the initial sample is limited. A strategy similar to the one presented in this work, using RGB-D (reg, green, blue plus depth) images, colour subtraction, and a CNN, was presented for the identification of fall events [24]. The difference lies in the source of the images. In this case, a Kinect sensor was used, also obtaining depth information that was used to eliminate the background. The accuracy is poorer, by far (74%). Regarding the use of specialised sensors such as the Kinect, the main problems of their implementation lies (a) in the increase in costs and (b) in the fact that there are already effective methods to extract a person from the background without their use. As in the previous case, the Kinect sensor is used in another approach [34]. Instead of subtracting the background, this paper makes use of the skeleton delivered by the proper device. It is worth noting that the proposal not only focuses on a single activity but tries to identify up to 12 activities in 5 different environments. It makes use of the hierarchical maximum-entropy Markov model, obtaining a global accuracy of 84%. Unlike in the previous approaches, the data source is traditional RGB (red, green, blue) images in another paper [27]. In addition, this paper extracts the person from the background using a CNN. The difference with our approach is that the authors train an RNN/LSTM (recurrent neural