# QRS Detection Based on Medical Knowledge and Cascades of Moving Average Filters
## 4 Discussion  
In this paper, we presented a QRS complex detection algorithm based on the knowledge of the electrocardiographic phenomena. The algorithm was evaluated on well-known databases and the performances we report are comparable to the best ones published in the literature. We considered several databases, in order to avoid overfitting on a single data source. It should be noted that some published approaches reach higher performances on specific databases, but caution should be exercised in direct comparison between published results. Different papers may adopt different subsets of records from the same databases and different acceptance windows. For this reason, the performances of the algorithm we proposed was compared to three available QRS detectors. As a performance metric, we computed the F1 scores as well as execution speed. We also reported sensitivity on ventricular beats and beats where bundle branch blocks were present, which we defined as Se-A, as they are more challenging to detect. As stated above, we chose to compare available QRS detectors instead of implementing other methods from literature, which was beyond the scope of this work. Additionally, rewriting a method is a developing effort itself. The resulting algorithm is not likely to reach the same accuracy and/or computational efficiency reported by the authors, as algorithms employ a set of specific parameters and rules that the authors have fine-tuned but do not end up in the final paper. We considered available QRS detectors for a direct comparison, so that results are reported for the same set of records, with the same acceptance rule for true positives. We chose the QRS detectors of [PERSON] [33], [PERSON] [34], and [PERSON] [25] as they were performing best among those we found available to our knowledge. We evaluated the QRS detection algorithm on the MIT-BIH Arrhythmia, EU ST-T, INCART, MIT-BIH Noise Stress Test, T Wave Alternans, and QT databases. They are popular databases in the topic of automated analysis, and especially for heartbeat detection. Our algorithm outperformed the others, reaching 99.18% gross F1 and 94.81% gross Se-A. Despite this, [PERSON]'s detector obtained a higher F1 score on the first channel of the MIT-BIH database. Detection accuracy for the second leads of the MITH.BIH Arrhythmia, Eu ST-T, and NST databases are lower for each algorithm. This happens as channel 2 is often chosen to highlight specific ECG features, like ST tract elevation, while the QRS complex is prominent in channel 1. The Se-A score was lower than the overall sensitivity, as anticipated. This is due to the different shape of this subset of beats, as the slopes of the QRS waves are low and so are the corresponding derivatives. For our algorithm the worst-case scenario of Se-V is 86.16%, for the first channel of the INCART database. This particular result is, however, substantially different from the other Se-V scores we report on the other databases (Table 4), or even the second channel of the same database. This may be caused by the annotation criteria on abnormal beats for channel 1 of the INCART database. For channel 2 of the INCART database and the other databases, sensitivity on abnormal beats lies between 94% and 99%. This means that up to 1 in every 20 abnormal beats is not detected correctly. Future work on this algorithm could address these instances of detection failure. Since \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Database**} & \multicolumn{4}{c}{**Execution Time (Seconds Per Hour of Signal)**} \\ \cline{2-5}  & **This Work** & **[PERSON]** & **[PERSON]** & **[PERSON]** \\ \hline Average & 0.1137 & 0.4460 & 33.1808 & 0.3388 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: QRS detection execution time. identification of abnormal beats is one of the main goals in Holter exams and other lengthier ECG recordings, we feel that sensitivity on abnormal beats is a key characteristic of any QRS detector.